Etan Kissling
c7d5ad78e1
avoid `--gc:arc` issue in validator key caching ( #6203 )
...
The current implementation of the validator key cache as introduced in
#5883 leads to issues when compiling with `--gc:arc`. Namely, the assert
in `injectdestructors.nim` > `destructiveMoveVar` is triggered:
```nim
assert n.kind != nkSym or not hasDestructor(c, n.sym.typ)
```
`cached == nkSym`, and `n.sym.typ == ref HashedValidatorPubKeyItem` with
`hasDestructor(c, n.sym.typ) == true`.
Inlining the `addr ...[]` avoids the problem and allows `--gc:arc`
compilation as part of LC wasm demo project.
Compilation command:
```sh
nim c \
-d:disable_libbacktrace \
-d:disableMarchNative \
-d:disableLTO \
-d:emscripten \
-d:release \
-d:useGcAssert \
-d:useSysAssert \
--debuginfo:off \
--nimcache:nimcache \
--os:linux \
--cpu:wasm32 \
--cc:clang \
--clang.exe:emcc \
--clang.linkerexe:emcc \
--gc:arc \
--exceptions:goto \
--define:noSignalHandler \
--define:danger \
--panics:on \
--passC:-fpic \
--passL:-Os \
--passL:-fpic \
--passC:'-pthread' \
--passL:'-pthread' \
--passC:'-sASSERTIONS' \
--passL:'-sASSERTIONS' \
--passC:'-sINITIAL_MEMORY=256MB' \
--passL:'-sINITIAL_MEMORY=256MB' \
--passC:'-sSTACK_SIZE=128MB' \
--passL:'-sSTACK_SIZE=128MB' \
--passC:'-sUSE_PTHREADS=1' \
--passL:'-sUSE_PTHREADS=1' \
--passC:'-sPTHREAD_POOL_SIZE_STRICT=0' \
--passL:'-sPTHREAD_POOL_SIZE_STRICT=0' \
--passL:'-sEXPORTED_FUNCTIONS="[_free, _malloc, _NimMain, _ETHRandomNumberCreate, _ETHConsensusConfigCreateFromYaml, _ETHConsensusConfigGetConsensusVersionAtEpoch, _ETHBeaconStateCreateFromSsz, _ETHBeaconStateDestroy, _ETHBeaconStateCopyGenesisValidatorsRoot, _ETHRootDestroy, _ETHForkDigestsCreateFromState, _ETHBeaconClockCreateFromState, _ETHBeaconClockGetSlot, _ETHLightClientStoreCreateFromBootstrap, _ETHLightClientStoreDestroy, _kETHLcSyncKind_UpdatesByRange, _kETHLcSyncKind_FinalityUpdate, _kETHLcSyncKind_OptimisticUpdate, _ETHLightClientStoreGetNextSyncTask, _ETHLightClientStoreGetMillisecondsToNextSyncTask, _ETHLightClientStoreProcessUpdatesByRange, _ETHLightClientStoreProcessFinalityUpdate, _ETHLightClientStoreProcessOptimisticUpdate, _ETHLightClientStoreGetFinalizedHeader, _ETHLightClientStoreIsNextSyncCommitteeKnown, _ETHLightClientStoreGetOptimisticHeader, _ETHLightClientStoreGetSafetyThreshold, _ETHLightClientHeaderCreateCopy, _ETHLightClientHeaderDestroy, _ETHLightClientHeaderCopyBeaconRoot, _ETHLightClientHeaderGetBeacon, _ETHBeaconBlockHeaderGetSlot, _ETHBeaconBlockHeaderGetProposerIndex, _ETHBeaconBlockHeaderGetParentRoot, _ETHBeaconBlockHeaderGetStateRoot, _ETHBeaconBlockHeaderGetBodyRoot, _ETHLightClientHeaderCopyExecutionHash, _ETHLightClientHeaderGetExecution, _ETHExecutionPayloadHeaderGetParentHash, _ETHExecutionPayloadHeaderGetFeeRecipient, _ETHExecutionPayloadHeaderGetStateRoot, _ETHExecutionPayloadHeaderGetReceiptsRoot, _ETHExecutionPayloadHeaderGetLogsBloom, _ETHExecutionPayloadHeaderGetPrevRandao, _ETHExecutionPayloadHeaderGetBlockNumber, _ETHExecutionPayloadHeaderGetGasLimit, _ETHExecutionPayloadHeaderGetGasUsed, _ETHExecutionPayloadHeaderGetTimestamp, _ETHExecutionPayloadHeaderGetExtraDataBytes, _ETHExecutionPayloadHeaderGetBaseFeePerGas, _ETHExecutionPayloadHeaderGetBlobGasUsed, _ETHExecutionPayloadHeaderGetExcessBlobGas, _ETHExecutionBlockHeaderCreateFromJson, _ETHExecutionBlockHeaderDestroy, _ETHExecutionBlockHeaderGetTransactionsRoot, _ETHExecutionBlockHeaderGetWithdrawalsRoot, _ETHTransactionsCreateFromJson, _ETHTransactionsDestroy, _ETHTransactionsGetCount, _ETHTransactionsGet, _ETHTransactionGetHash, _ETHTransactionGetFrom, _ETHTransactionGetNonce, _ETHTransactionGetMaxPriorityFeePerGas, _ETHTransactionGetMaxFeePerGas, _ETHTransactionGetGas, _ETHTransactionIsCreatingContract, _ETHTransactionGetTo, _ETHTransactionGetValue, _ETHTransactionGetInputBytes, _ETHTransactionGetBytes, _ETHTransactionGetEip6493Root, _ETHTransactionGetEip6493Bytes, _ETHTransactionGetNumEip6493SnappyBytes, _ETHReceiptsCreateFromJson, _ETHReceiptsDestroy, _ETHReceiptsGet, _ETHReceiptHasStatus, _ETHReceiptGetBytes, _ETHReceiptGetEip6493Bytes, _ETHReceiptGetNumEip6493SnappyBytes]"' \
--passL:'-sEXPORTED_RUNTIME_METHODS="[lengthBytesUTF8, stringToNewUTF8]"' \
--passL:'-Wl,--no-entry' \
--noMain:on \
--passL:'-o libnimbus_lc.js' \
nimbus-eth2/beacon_chain/libnimbus_lc/libnimbus_lc.nim
```
2024-04-16 11:47:18 +02:00
Eugene Kabanov
c5f04dd237
produceBlockV3 call should send `execution_payload_blinded` value as boolean. ( #6204 )
...
* Fix `execution_payload_blinded` in produceBlockV3 response should be boolean not string.
* Address review comments.
2024-04-15 23:08:41 +00:00
Etan Kissling
c57fcb426a
bump `nim-libp2p` to `89cad5a3ba9088cc721682469a10917903da25a0` ( #6199 )
...
- add support for setting protocol handlers with `{.raises.}` annotation
- fix: valueOr and withValue utilities
- fix: remove explicit param from GossipSubParams constructor
2024-04-12 11:12:44 +02:00
Etan Kissling
6530a36a0f
bump `nim-nat-traversal` to `4c4fc6f1436b5e0468a6b3a7929bb603f0b43f33` ( #6197 )
...
- bump `miniupnp` to `miniupnpc_2_2_7`
2024-04-11 18:10:19 +02:00
tersec
e51c5ec783
add Electra blob support to block/blob quarantines, block processor, and request manager ( #6201 )
2024-04-11 09:31:39 +00:00
tersec
205d63a897
fill in executionpayload for/from GetPayloadV4 ( #6200 )
2024-04-10 23:34:34 +00:00
Etan Kissling
b9f9fc4035
bump `nim-json-serialization` to `1ac1d69f9512d55d15e8218a9dbdff129bf96ddb` ( #6198 )
...
- Add JsonValueRef compare operation
2024-04-10 18:50:44 +00:00
Etan Kissling
c332c88f40
bump `nim-libbacktrace` to `66864ed4ae18d14a2b4acb4549561efd7755351f` ( #6196 )
...
- quote and library paths for use in passc/passl to allow embedded spaces
- use strutils.escape to handle more special chars
2024-04-10 17:30:28 +00:00
Etan Kissling
2f388df0b4
bump `nim-normalize` to `b828f07037c87382b7f20f96e6cca6e85788dd25` ( #6195 )
...
- test refc in Nim 2.0 and newer
- update CI
- update CI
2024-04-10 16:21:55 +00:00
Etan Kissling
7e58286887
bump `nim-snappy` to `aaef74113cadaaca690c6144eae0cf2c2a10db28` ( #6194 )
...
- bump `snappycpp` to `1.2.0`
2024-04-10 15:36:55 +00:00
Etan Kissling
b305a58f57
bump `nim-unicodedb` to `3db16f8ece5d0eba310c8f1ed812c6ff5a21a34a` ( #6193 )
...
- test refc in Nim 2.0 and newer
- update CI
- update CI
2024-04-10 17:03:36 +02:00
Etan Kissling
ef3aeb09a1
bump `nimbus-build-system` to `d7e7f1044def3c62d0b4bcec60c0b53876e44d71` ( #6192 )
...
- fix miniupnpc build on Windows by not escaping PATH
- allow overriding CC for libimiupnpc.a and libnatpmp.a targets
- Use -fPIC when building nat traversal
2024-04-10 16:35:09 +02:00
Etan Kissling
9bffc51cf6
allow frontfilling finalized CP block from era file ( #6164 )
...
Add support for using era file for the initial checkpoint block.
This should also avoid an error when the beacon node is restarted
before the backfill process has made any progress (#6059 ).
2024-04-10 14:11:07 +02:00
Etan Kissling
a561024d88
rank peers by their score instead of their memory address ( #6149 )
...
The `<` function to compare peers was not exported, leading to the same
peer be acquired over and over again until kick. `mixin` doesn't pull it
into `peerCmp` without `*` export, and with the export no mixin needed.
2024-04-10 14:09:37 +02:00
tersec
e7dede344a
bump nim-web3 to get updated Pectra GetPayloadV4 types ( #6191 )
2024-04-10 11:38:38 +02:00
tersec
1bf4058e22
add Electra support to beacon API produceBlindedBlock and produceBlockV3 endpoints; add further VC publish(Blinded)Block Electra support ( #6190 )
2024-04-10 10:54:00 +02:00
tersec
8a30cffbcc
initial VC Electra publishBlock support ( #6189 )
2024-04-09 16:54:05 +02:00
tersec
749a45695f
support engine_newPayloadV4 ( #6188 )
2024-04-09 12:44:03 +02:00
tersec
6ce5d5814c
support electra block proposals for internal BN validators ( #6187 )
2024-04-09 12:04:33 +02:00
Etan Kissling
b8eb51852c
bump `gnosis-chain-configs` to `cf17b34b6e999d1bd70b0f557d85ae0d1931d92b` ( #6186 )
...
- chore: add new bootnodes and remove obsolete ones for GnosisDAO
2024-04-08 18:11:02 +02:00
tersec
ba45a1821c
implement Electra beacon API publishBlindedBlock ( #6185 )
2024-04-08 18:03:20 +02:00
Etan Kissling
41a3b62fe2
update `wss_sim` for Bellatrix, Capella and Deneb ( #6170 )
...
The `wss_sim` was not properly maintained since Bellatrix. The missing
functionality is now added, including:
- Bellatrix: Connect to an EL for execution payload production
- Capella: Correct withdrawals processing, is mandatory to do
- Deneb: Dump blob sidecars into the output directory
See https://ethresear.ch/t/insecura-my-consensus-for-the-pyrmont-network/11833
2024-04-08 15:28:46 +02:00
tersec
97bfca4b88
implement Electra beacon API getBlindedBlock ( #6183 )
2024-04-08 14:49:03 +02:00
tersec
361be082ae
add Electra toSignedBlindedBlock tests ( #6182 )
2024-04-08 10:34:15 +02:00
tersec
937cc62b85
block_sim runs electra ( #6181 )
2024-04-07 09:58:11 +02:00
tersec
27921406e9
remove some debugRaiseAsserts and fill in Electra functionality ( #6179 )
2024-04-06 15:11:47 +02:00
tersec
0d534224b3
remove some debugRaiseAsserts and fill in Electra functionality ( #6178 )
2024-04-06 07:46:02 +00:00
tersec
06894dd2f6
remove some debugRaiseAsserts and fill in Electra functionality ( #6177 )
2024-04-05 21:30:06 +02:00
Etan Kissling
86a265308a
filter out `nil` values when iterating peers ( #6151 )
...
Iterating peers should only yield peers present in registry, otherwise
`nil` pointers are returned and depending on comparison function it will
break, see #6149 .
2024-04-05 16:38:04 +02:00
tersec
08d6dc347e
rm payload transaction value calculation for Bellatrix engine API ( #6173 )
2024-04-04 06:33:08 +02:00
tersec
0b6f75b88b
remove some debugRaiseAsserts and fill in actual Electra functionality ( #6172 )
2024-04-04 05:17:31 +02:00
tersec
13a70e9d69
rm built-in Goerli beacon chain support ( #6057 )
2024-04-03 23:25:36 +00:00
Etan Kissling
df0ff5f0fb
fix initialization of sync committee cache after loading non-epoch state ( #6160 )
...
When initializing from a state that's not aligned to an epoch boundary,
an earlier state is loaded that's epoch aligned, and subsequently topped
up with the missing blocks. `dag.headSyncCommittee` is initialized prior
to topping up the missing blocks, though. If the sync committee changes
while applying the blocks (e.g., a sync committee period boundary hits),
the cached information becomes unlinked from `dag.head`, leading to
valid blocks based on that chain being rejected. To fix this, move cache
initialization after the top up with blocks. This has been observed on
Goerli by initializing from 7919502 and attempting to top up 7920111.
The block gets rejected with an invalid state root on nodes that have
restarted after setting 7920111 as head, while it gets accepted by all
other nodes. Error message is `block: state root verification failed`.
The incorrect initialization behaviour was introduced in #4592 , before
which the sync committee cache was initialized after applying blocks.
2024-04-03 23:03:06 +02:00
Etan Kissling
96e27d9d35
avoid modifying blobless collection during iteration in edge case ( #6168 )
...
The fallback when blobless quarantine contains a block with all blobs
modifies collection while iterating, potentially asserting if reachable.
Using a second loop to process this situation resolves that.
2024-04-03 23:02:24 +02:00
dependabot[bot]
67ade106cc
Bump pillow from 10.2.0 to 10.3.0 in /ncli ( #6171 )
...
Bumps [pillow](https://github.com/python-pillow/Pillow ) from 10.2.0 to 10.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases )
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst )
- [Commits](https://github.com/python-pillow/Pillow/compare/10.2.0...10.3.0 )
---
updated-dependencies:
- dependency-name: pillow
dependency-type: direct:production
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 18:56:42 +00:00
Etan Kissling
8d0a4a87e7
add function to import blobs to `ncli_db` ( #6166 )
...
* add function to import blobs to `ncli_db`
`ncli_db` does not support importing blobs, making it impossible to
complete the database solely from dumped files. Add the missing support.
* pass `cfg`
2024-04-03 18:55:53 +00:00
tersec
7fa32b7f02
add Electra to ConsensusFork enum ( #6169 )
...
* add Electra to ConsensusFork enum
* fix gnosis check
2024-04-03 16:43:43 +02:00
tersec
c2a2b76f93
allow Jenkins to specify Nim version to use ( #6162 )
2024-04-03 10:47:32 +00:00
Etan Kissling
6a318d0f1a
avoid rejecting empty era file in verification ( #6163 )
...
`batchVerify`'s precondition is a non-empty signature list:
```nim
if input.len == 0:
# Spec precondition
return false
```
This means that in eras without any blocks (as has happened on Goerli),
calling it leads to era files being reported as invalid.
2024-04-03 10:06:21 +02:00
Etan Kissling
0000f81df0
remove unused and redundant `PayloadID` type definition ( #6165 )
...
`PayloadID` is defined in `nim-web3` and our own Bellatrix definition
can be removed.
2024-04-03 07:27:00 +02:00
tersec
27ec2893ff
rm unused parameters of get_state_exit_queue_info() ( #6167 )
2024-04-03 01:45:57 +00:00
Etan Kissling
5f4fa9ae69
avoid code repetition across forks for signed block contents ( #6150 )
...
Use forks sugar to make `RestPublishedSignedBlockContents` more concise.
2024-04-03 02:05:29 +02:00
tersec
109007dc93
avoid quadratic behavior exiting validators ( #6161 )
...
* avoid quadratic behavior exiting validators
* fix libnfuzz callers
2024-04-02 12:18:40 +00:00
tersec
4457334dd0
Add support for Pectra ExecutionPayload representations ( #6158 )
2024-03-29 13:37:27 +01:00
tersec
54ccb24782
Revert "bump nim-libbacktrace handle special characters in source paths ( #6142 )" ( #6157 )
...
This reverts commit f590970fd3
.
2024-03-29 06:15:11 +00:00
tersec
c42a1f2863
Merge remote-tracking branch 'origin/stable' into unstable
2024-03-29 02:47:44 +00:00
tersec
dc19b082a9
update release date for v24.3.0
2024-03-29 02:26:30 +00:00
Jacek Sieka
79898934dc
ssz: bump ( #6155 )
...
should fix `dereferencing pointer to incomplete type` errors seen on
some gcc versions
2024-03-29 01:17:35 +00:00
Jacek Sieka
0495c15a23
ssz: bump ( #6155 )
...
should fix `dereferencing pointer to incomplete type` errors seen on
some gcc versions
2024-03-29 00:09:43 +01:00
Etan Kissling
e677d98119
fix check docs stage in jenkins ( #6156 )
...
Ignore color information when checking consistency of options.md with
the built binary.
2024-03-28 21:37:21 +01:00