Commit Graph

3858 Commits

Author SHA1 Message Date
Jacek Sieka 3ff9b69bf1
simplify eth2_network error handling (#5765)
This PR gets rid of a bunch of redundant exception handling through
async raises guarantees.

More can be removed once libp2p gets properly annotated.
2024-01-19 21:05:52 +00:00
Etan Kissling a5daa6d7e9
bump `holesky` to `d05bc1cd68dd16a54fb844181191ccaba15bd5ef` (#5796)
- schedule dencun on holesky
2024-01-19 15:40:02 +00:00
Eugene Kabanov 3648df7d4c
Fix VC not always be able to obtain feeRecipient value. (#5781)
Use state's validator value to obtain feeRecipient value.
Make feeRecipient and gasLimit calculation equal for BN and VC.
2024-01-19 14:36:04 +00:00
Etan Kissling d6e55ca3d8
fix improper `yield` usage in `el_manager` (#5789)
`yield` is not supported in `{.async.}`. Replace with alternative that
does not leak.
2024-01-19 07:18:02 +00:00
Etan Kissling d59632acd0
remove obsolete `curSlot` variable (#5786)
#5773 removed catching up on validator duties after lag. The `curSlot`
variable that was used originally to track catch-up progress no longer
has a use and is also no longer properly updated. Remove it.
2024-01-19 03:21:38 +00:00
tersec 545fb17649
use RestPlainResponse to improve builder API rerror reporting (#5777) 2024-01-19 03:20:47 +00:00
Etan Kissling e06853d8e6
bump `sepolia` to `ff09a161f61959285c64b355d452cd25eae094bd` (#5795)
- schedule dencun on sepolia
2024-01-19 04:09:17 +01:00
Etan Kissling be73ce2e9a
import finalized head LC bootstrap on launch (#5775)
If the initial state replays cover the finalized head, import matching
`LightClientBootstrap` into database.

This also addresses this error when light client requests bootstrap from
the genesis slot on networks that launch with Altair enabled.

```
{"lvl":"DBG","ts":"2023-10-04 11:17:49.665+00:00","msg":"LC bootstrap unavailable: Sync committee branch not cached","topics":"chaindag_lc","slot":0}
```
2024-01-18 22:51:26 +00:00
Etan Kissling 006fa59ec2
use consensus spec v1.4.0-beta.6 test vectors (#5783) 2024-01-18 18:14:44 +00:00
tersec db7909c1fe
don't catch up on validator duties (#5773) 2024-01-18 15:56:43 +00:00
Etan Kissling 62ee92a094
bolster `BlobSidecar` syncing on incomplete responses (#5766)
Avoid marking blocks invalid when corresponding `blobSidecarsByRange`
returns an incomplete / incorrect response while syncing. The block
itself may still be valid in that scenario.
2024-01-18 15:45:10 +01:00
tersec 36545e1d84
remove expensive logging from function called in prepareBeaconProposer inner loop (#5776) 2024-01-17 22:58:46 +00:00
Etan Kissling e7794b6aec
log `delay` relative to deadline (#5769)
To better analyze logs across different `SECONDS_PER_SLOT`, log delays
for duties relative to their deadline instead of relative to slot start.
2024-01-17 15:52:19 +01:00
Etan Kissling f409ed97ae
align sync contribution logs with aggregate processing (#5770)
There are two conditions leading to `duplicate contribution` log.
Align the logs with the ones used for attestation aggregates,
so that the two conditions can be separated when reading logs.
2024-01-17 15:46:54 +01:00
Jacek Sieka d5785677a8
split out eth1chain into its own module (#5768)
reduces import junk in some places - more could be done here
2024-01-17 15:26:16 +01:00
Etan Kissling 68d0542ae1
log `const_preset` on beacon node startup (#5764)
To understand what binary is being used (regular / minimal / gnosis),
extend launch logging.
2024-01-17 14:38:56 +01:00
Etan Kissling 11ebbe0cac
fix LC header production for Deneb (#5763)
The `blob_gas_used` field was not properly populated when constructing
Deneb light client data. This is due to #5026 not applying the change to
the entire codebase when the new field got introduced, and due to #5350
not catching that oversight in other modules. Also reviewed codebase and
discovered that `shortLog` for Deneb execution payloads has same bug.
2024-01-16 22:54:20 +00:00
tersec cf1bec7670
update some deprecated stew/results to results imports (#5743) 2024-01-16 22:37:14 +00:00
Jacek Sieka 19860029c2
use `macrocache` for protocol index counter (#5745) 2024-01-16 18:37:47 +00:00
Etan Kissling ad74c1a6a5
add vanity mascot for upcoming fork to status bar (#5761)
To simplify supporting "am I ready for the fork" requests, add a simple
marker to the default status bar that indicates readiness by displaying
the fork's corresponding mascot. This is the same one that is also
displayed during the actual fork transition, so does not introduce
new dependencies. It also only shows in default status bar, not in logs.
2024-01-16 17:33:46 +00:00
Etan Kissling b382833f43
workaround random `SIGSEGV` on macOS aarch64 CI (#5757)
Separate a `let` block into multiple `let` statements to reduce
probability of hitting random `SIGSEGV` during flaky CI tests.

whatever... 🤯
2024-01-16 13:41:49 +01:00
tersec 8cfce83864
make constants 64-bit portably (#5755) 2024-01-16 02:26:18 +01:00
Etan Kissling 7443a4ac08
load Ethereum mainnet KZG setup on Gnosis networks (#5756)
Gnosis networks re-use the trusted setup from Ethereum mainnet.
Load it to support Deneb.
2024-01-16 01:58:07 +01:00
Etan Kissling 39a2a91003
only show upcoming fork info if one is scheduled (#5751)
This ensures that information about the next scheduled fork is only
displayed if one is actually scheduled. Current fork name is no longer
shown.
2024-01-15 17:48:03 +01:00
tersec 3541cfe020
remove extraneous length checks in KZG batch proofs (#5744)
* remove extraneous length checks in KZG batch proofs

* re-add winservice import but only for Windows, to avoid UnusedImport warning

* also uses establishWindowsService
2024-01-15 16:53:34 +01:00
tersec 2c49caced9
report decimal produceBlockV3 consensus block, execution payload values (#5741) 2024-01-14 22:59:08 +01:00
Eugene Kabanov 5404178a40
Dissect Windows specific code from beacon node. (#5612)
* Make some startup procedures async.
Add more handful makeBannerAndConfig().

* Dissect windows service code from `nimbus_beacon_node.nim`.

* Add report service startup errors using windows error codes.
Add plug able exitService().

Co-authored-by: Zahary Karadjov <zahary@status.im>
Co-authored-by: Jacek Sieka <jacek@status.im>
2024-01-13 12:53:53 +02:00
Zahary Karadjov 05fb7ffff0
Don't require getopt to be installed by brew on macOS for Nix users
Other changes:

* Add/Update copyright banners
* Add post-review comment for https://github.com/status-im/nimbus-eth2/pull/5719
2024-01-13 12:37:41 +02:00
Jacek Sieka b98f46c04d
Avoid global in p2p macro (fixes #4578) (#5719)
* Avoid global in p2p macro (fixes #4578)

* copy p2p macro to this repo and start de-crufting it
* make protocol registration dynamic, removing light client hacks et al
* split out light client protocol into its own file

* cleanups

* Option -> Opt
* remove more cruft

* further split beacon_sync

this allows the light client to respond to peer metadata messages
without exposing the block sync protocol

* better protocol init

* "constant" protocol index

* avoid casts

* copyright

* move some discovery code to discovery

* avoid extraneous data copy when sending chunks

* remove redundant forkdigest field

* document how to connect to a specific peer
2024-01-13 11:54:24 +02:00
tersec 69af8f943e
implement blob_sidecar Beacon API streaming (#5728) 2024-01-13 11:52:13 +02:00
tersec 1559a09184
add more logging of KZG commitments, proofs, and blobs (#5735) 2024-01-13 07:44:40 +01:00
andri lim 017f9f1103
bump nim-web3 to bf1ce869b5f76d9744444b248f6f5c6c782fedc7 (#5722)
Etan Kissling (2):
  remove unused `skip0xPrefix`
  keep the internal count helper

Will (1):
  Bugfix/nully values (#61)

Yuriy Glukhov (5):
  Contract constructor support
  Fixed compilation error in exec function
  Added string encoding
  Fixed source->from field of EthCall
  More flexibility to contract DSL, Async contract caller

jangko (5):
  Reduce compiler warnings when using Nim v2
  Migrate to json-serialization
  Add tests of json rpc marshalled types
  Resolve contract_dsl ambiguity
  Event handler passing around JsonString instead of JsonNode
  Share encoder between json-rpc and chronicles (#119)
  Simplify generic constraint of rpc and chronicles encoders
  Feature/execution api spec (#69)
  v0.3.0

bump nim-json-rpc to a6475e49b26d3afc58aaa3d67621c94eafef8efb
coffeepots (1):
  Use nim-json-serialization for RPCs (#172)

jangko (10):
  Add copyright to source file
  Remove StringOfJson
  Fix optional parameter parsing fails in rpc macro with generics
  Rename jrpc_sys module back to jsonmarshal
  Reenable test hhtps
  Add test for createRpcSigsFromNim and createSingleRpcSig
  Let the OS choose the port for tests
  Add onProcessMessage hook to client
  Fix example in the README.md
  Move errors module back to json_rpc folder
  Upgrade rpc router internals (#178)
  RPC server handle null return value correctly
  v0.3.0

kdeme (1):
  Add example test case that currently fails the Option parsing
2024-01-13 08:36:17 +07:00
Etan Kissling 16256a5230
display current fork (+ next fork if applicable) in slot start / status (#5731)
Extend slot start message and default status bar with information about
current head fork and the next fork transition (corresponding to head).
This is useful to know whether a synced client is aware of a future fork
and can also be useful when syncing from old forks to follow progress
across the various forks.

```
 peers: 8 ❯ finalized: 741c2ce2:230474 ❯ head: b330f58b:230477:20 ❯ fork: Capella (next: Deneb:231680) ❯ time: 230599:24 (7379192) ❯ sync: 00h24m (99.63%) 2.6492slots/s (QwQUwQPQDQ:7375263)/opt
```

```
INF 2024-01-12 12:18:00.001+01:00 Slot start                                 topics="beacnde" slot=7379190 epoch=230599 fork="Capella (next: Deneb:231680)" sync="--h--m (99.62%) 0.0000slots/s (wwwwwwwwww:7375167)/opt" peers=0 head=741c2ce2:7375168 finalized=230472:723abe7e delay=1ms861us
```
2024-01-12 21:40:34 +01:00
Etan Kissling b54bbdecae
bump `gnosis-chain-configs` to `ff5fbe9aecbf28df9beedb662920eeee537629b0` (#5725)
- Add deneb config vars to Chiado config
- Schedule Deneb on Chiado
2024-01-12 11:31:07 +01:00
tersec 251143fd51
attest to known valid block when possible (#5313)
* attest to known valid block when possible

* cleaner approach; slot is always == attestation slot itself

* copyright year linting
2024-01-11 22:34:10 +00:00
Jacek Sieka e4a1ae67df
ssz: bump (#5717)
height-based merkleizer
2024-01-11 18:34:44 +01:00
tersec 07455e67a9
`proc` to `func` in engine authentication (#5718) 2024-01-08 21:12:58 +00:00
Zahary Karadjov 401d6bac91
Merge branch 'stable' into unstable 2024-01-08 19:06:46 +02:00
Zahary Karadjov 0e63f8fdba
Version 24.1.1 2024-01-08 19:06:03 +02:00
Etan Kissling 3c9d17a9d2
fix crash when attaching to syncing EL (#5695)
In #5664, `nim-json-rpc` dependency got bumped which included a change
in behaviour when processing `null` data for heap allocated objects.

- https://github.com/status-im/nim-json-rpc/pull/176

Old behaviour was to raise an exception, while new behaviour is to set
the value to `nil` but treat it as a successful parse. Old exceptions
were similar to "Parameter [result] expected JObject but got JNull".

As part of the `nim-json-rpc` bump in #5664, `el_manager.nim` was not
updated to match the new behaviour, leading to crash whenever its logic
assumes that a successfully parsed web3 `BlockObject` (heap allocated)
may be assumed to be non-`nil`.

As a quick remedy, the `el_manager.nim` is updated to transform `nil`
responses for `BlockObject` into `ValueError`, allowing reuse of the
existing and tested exception based processing.
2024-01-08 18:58:33 +02:00
Etan Kissling f84f320cba
fix crash when attaching to syncing EL (#5695)
In #5664, `nim-json-rpc` dependency got bumped which included a change
in behaviour when processing `null` data for heap allocated objects.

- https://github.com/status-im/nim-json-rpc/pull/176

Old behaviour was to raise an exception, while new behaviour is to set
the value to `nil` but treat it as a successful parse. Old exceptions
were similar to "Parameter [result] expected JObject but got JNull".

As part of the `nim-json-rpc` bump in #5664, `el_manager.nim` was not
updated to match the new behaviour, leading to crash whenever its logic
assumes that a successfully parsed web3 `BlockObject` (heap allocated)
may be assumed to be non-`nil`.

As a quick remedy, the `el_manager.nim` is updated to transform `nil`
responses for `BlockObject` into `ValueError`, allowing reuse of the
existing and tested exception based processing.
2024-01-08 18:53:29 +02:00
Etan Kissling 185b452249
bump `nim-web3` to `45d09b29d22da63052b259679539a3d4141273a7` (#5699)
- Refactoring, contract dsl wasm compatibility, encode/decode fixes.
2024-01-06 16:41:59 +01:00
Jacek Sieka 62cbdeefc5
verify `genesis_time` more strictly (fixes #1667) (#5694)
Bogus values lead to crashes down the line when timers overflow
2024-01-06 15:26:56 +01:00
Etan Kissling 508f3b6368
add missing `std/` prefix to more imports (#5696)
Bumping some `std` imports to explicitly include the prefix.
Also add explicit `./` prefix for local directory imports.
2024-01-06 07:18:28 +01:00
Jacek Sieka 3f525acb87
chronos: bump (#5684)
This PR causes a few new warnings to appear - these are harmless but
will need addressing separately as they span several libraries.

* new asyncraises syntax
* asyncraises support in several modules
* `sink` usage reduces spurious copying
* `?` compatiblity for `async` + `results`
* remove `-d:chronosStrictException` (obsolete)
2024-01-05 10:08:38 +01:00
Zahary Karadjov 4d094422eb
Merge branch 'stable' into unstable 2024-01-04 02:54:16 +02:00
Zahary Karadjov 00ba72a73e
Version 24.1.0 2024-01-04 01:24:00 +02:00
Etan Kissling 7467dd911a
bump `goerli` to `6522ac6684693740cd4ddcc2a0662e03702aa4a1` (#5687)
- schedule dencun on goerli
2024-01-04 00:55:33 +02:00
Etan Kissling 875946600e
load Goerli metadata from `goerli` repo (#5680)
The `eth2-networks` repo often receives metadata updates with a delay.
Switch to `goerli` repo to obtain the latest config (Dencun scheduling)
when it is updated. This is in line with how Sepolia / Holesky work.

- https://github.com/eth-clients/goerli/pull/178
2024-01-04 00:55:15 +02:00
Etan Kissling 7db95f047b
track latest `LightClientUpdate` only once fork choice selects it (#5691)
Instead of tracking the latest `LightClientUpdate` across all branches,
track the latest one on the current branch as selected by fork choice.
2024-01-03 23:36:05 +01:00