Commit Graph

107 Commits

Author SHA1 Message Date
Etan Kissling a769550db5
rename LC gindex constants to match spec ()
Use `_ELECTRA` suffix for gindex constants to match consensus-specs.
2024-07-23 20:20:15 +00:00
Etan Kissling 1fd246b23e
explicitly refer to attestation fork in SSZ consensus object tests ()
Use fully qualified types when referring to attestation related types
in tests. We should also consider to merge these to a single runner.
2024-07-03 01:40:47 +00:00
Etan Kissling 9924aec1e3
extend light client protocol for Electra ()
* extend light client protocol for Electra

Add missing Electra support for light client protocol:

- https://github.com/ethereum/consensus-specs/pull/3811

Tested against PR consensus-spec-tests, the test runner automatically
picks up the new tests once available.

* workaround `version-2-0`: `Error: cannot instantiate: 'SomeUnsignedInt'`

* fix initialization when Electra not scheduled

* try reduce stack size in test

* put correct sync committee branch version into DB

* adjust fork schedule in light client data tests

* further reduce stack size

* split function into multiple parts

* rename variable

* regenerate test reports to cover new Electra tests

* add Nim bug reference
2024-06-26 19:02:03 +00:00
tersec 88fa8b17ea
automated consensus spec URL updating to v1.5.0-alpha.3 () 2024-06-16 02:59:25 +02:00
tersec 77d926525f
stop using deprecated stew/results ()
* stop using deprecated stew/results

* exception tracking linting
2024-06-11 02:34:56 +00:00
tersec c7bf6fb542
rm debugRaiseAssert; clean up several debugComments ()
* rm debugRaiseAssert; clean up several debugComments

* exception linting
2024-05-23 23:51:09 +02:00
tersec 6b8061b5d6
automated consensus spec URL updating to v1.5.0-alpha.2 () 2024-05-09 05:03:10 +00:00
tersec d139c92df9
explicitly scope AttesterSlashing and IndexedAttestation types to phase0 () 2024-04-21 05:49:11 +00:00
tersec 603c83522e
explicitly refer to phase0.{Attestation,TrustedAttestation} rather than sans module name () 2024-04-17 20:44:29 +00:00
tersec 27ec2893ff
rm unused parameters of get_state_exit_queue_info() () 2024-04-03 01:45:57 +00:00
tersec 109007dc93
avoid quadratic behavior exiting validators ()
* avoid quadratic behavior exiting validators

* fix libnfuzz callers
2024-04-02 12:18:40 +00:00
Etan Kissling 5d42859176
make `Gwei` `distinct` ()
 introduced a subtle change to `nim-web3` resulting in `Gwei` to be
serialized differently than before. Using a `distinct` type for `Gwei`
improves type safety and avoids such problems in the future.
2024-03-19 14:22:07 +01:00
tersec 0a6d189161
automated consensus spec URL updating to v1.4.0 () 2024-03-14 07:26:36 +01:00
tersec 816361ed8c
Bloom filter acceleration for deposit processing () 2024-03-07 23:38:24 +00:00
tersec 2a13c09615
add proposer reward accounting to block transitions ()
* add proposer reward accounting to block transitions

* Update beacon_chain/spec/state_transition_block.nim

Co-authored-by: Etan Kissling <etan@status.im>

---------

Co-authored-by: Etan Kissling <etan@status.im>
2024-03-04 17:00:46 +00:00
Etan Kissling f5e9d3ffe4
add trivial `{.push raises: [].}` to `research` and `test` folders ()
Annotate the `research` and `test` files for which no further changes
are needed to successfully compile them, to not interfere with periodic
tasks such as spec reference bumps.
2024-02-29 13:24:08 +00:00
Etan Kissling f4ff438aab
explicitly mention `{.raises.}` in `tests` folder ()
Add `{.raises.}` annotations to `tests` files where needed to enable
`{.push raises: [].}`. Avoids interfering with periodic changes such as
spec version bumps, and avoids special casing folders when editing.
The effort to maintain `{.raises.}` is trivial after the initial round.
2024-02-29 10:28:32 +00:00
Etan Kissling 4a74ef9cba
add `{.raises.}` annotations to `test_fixture_operations` ()
Some more progress in making exception flow explicit.
2024-02-28 11:54:29 +00:00
Etan Kissling 702f4c6a45
add `{.push raises: [].}` to more files ()
Extend `{.push raises: [].}` to all files with spec references that are
periodically updated.

- https://github.com/status-im/nimbus-eth2/pull/5942
2024-02-22 11:03:09 +01:00
tersec c73d7c6f6f
automated consensus spec URL updating to v1.4.0-beta.7 () 2024-02-21 19:44:48 +00:00
tersec 7fd8beb418
rm unused code in {ncli,research,tests}/ () 2024-01-21 07:55:03 +01:00
tersec 6c53dc1e11
automated consensus spec URL updating to v1.4.0-beta.6 () 2024-01-20 11:19:47 +00:00
Jacek Sieka 62cbdeefc5
verify `genesis_time` more strictly (fixes ) ()
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 ()
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
tersec 9efb2958ec
automated consensus spec URL updating to v1.4.0-beta.5 () 2023-12-05 03:34:45 +01:00
Etan Kissling d9031d97dc
rename `_INDEX` generalized index constants to `_GINDEX` ()
Rename constants for consistency with upcoming spec adjustment:

- https://github.com/ethereum/consensus-specs/pull/3537
2023-11-09 12:54:44 +00:00
tersec 7e3aeaea09
automated consensus spec URL updating to v1.4.0-beta.4 () 2023-11-08 05:28:03 +00:00
tersec 4ddd771127
automated consensus spec URL updating to v1.4.0-beta.3 () 2023-10-19 10:26:38 +00:00
tersec 2895a9a05c
automated consensus spec URL updating to v1.4.0-beta.2 () 2023-09-21 18:06:51 +00:00
tersec cc13e0b7e0
restore full test coverage for process_rewards_and_penalties ()
* restore full test coverage for process_rewards_and_penalties

* adjust ncli_db to use new iterator
2023-09-08 16:42:18 +00:00
Etan Kissling 81397342d0
fix relative import paths for Nim 2.0 ()
In Nim 2.0, relative `import` paths are validated more strictly;
this fixes the incorrect paths used in some tests.
2023-09-06 08:17:59 +00:00
Jacek Sieka 6fab826487
bump unittest2, clean up suite names ()
Suite names were not being used because `test` has to have access to it
during instantiation - this PR cleans things up a little while at the
same time upgrading unittest2.
2023-09-04 13:05:11 +00:00
tersec 85e1976ac3
automated consensus spec URL updating to v1.4.0-beta.1 () 2023-08-09 03:58:47 +00:00
Jacek Sieka 5bc48acc36
reduce memory allocations during state transition ()
This PR removes a few hundred thousand temporary seq allocations during
state transition - in particular, the flag seq was allocated per
validator while committees are computed per attestation.
2023-08-03 01:03:40 +02:00
tersec 614202e30d
automated consensus spec URL updating to v1.4.0-beta.0 () 2023-06-24 15:43:30 +00:00
Etan Kissling 3a6b50cf21
require sync committee supermajority in CI ()
* require sync committee supermajority in CI

To better catch problems with sync committee messages in CI, extend
local testnet simulation to also verify that each block is signed
by a supermajority of the sync committee.

Requires  and 

* lint
2023-06-17 06:00:01 +00:00
tersec 788cdb7133
automated v1.4.0-alpha.2 to v1.4.0-alpha.3 consensus spec URL updates () 2023-06-13 14:03:49 +00:00
tersec 22208836b1
automated v1.4.0-alpha.1 to v1.4.0-alpha.2 consensus spec URL updates () 2023-06-10 09:56:54 +00:00
tersec f86febc111
update consensus spec URLs to v1.4.0-alpha.1 () 2023-06-04 10:32:50 +00:00
tersec 1f535336da
automated v1.3.0 to v1.4.0-alpha.0 consensus spec URL updates ()
* automated v1.3.0 to v1.4.0-alpha.0 consensus spec URL updates

* add copyright year headers
2023-05-26 00:14:28 +02:00
Etan Kissling 22c298c07b
final portion of trivial v1.3.0 bumps ()
* final portion of trivial v1.3.0 bumps

Updates unchanged logic to latest v1.3.0 consensus-specs refs.

```
https://github.com/ethereum/consensus-specs/(blob|tree)/(?!v1\.3\.0/)
```

* lint
2023-05-11 09:54:29 +00:00
Eugene Kabanov e51095e2f8
Fix Windows MAX_PATH constraint issue in CI. ()
* Fix MAX_PATH limitation in tests.

* Fix posix issues.

* Fix compilation issue.
2023-02-10 21:59:38 +01:00
Etan Kissling 609227559f
LC data fork cleanup ()
Distinguish between those code locations that need to be updated on each
light client data format change, and those others that should generally
be fine, as long as a valid light client object is processed.

The former are tagged with static assert for `LightClientDataFork.high`.

The latter are changed to `lcDataFork > LightClientDataFork.None` to
indicate that they depend only on presence of any valid object.
Also bundled a few minor cleanups and fixes.

Also add `Forky` type for `LightClientStore` and minor fixes / cleanups.
2023-01-14 22:19:50 +01:00
tersec 68e08c6f15
use v1.3.0-rc.1 consensus spec test vectors () 2023-01-14 04:20:51 +00:00
Etan Kissling 2324136552
add `LightClientHeader` wrapper ()
The light client data structures were changed to accommodate additional
fields in future forks (e.g., to also hold execution data).

There is a minor change to the JSON serialization, where the `header`
properties are now nested inside a `LightClientHeader`.
The SSZ serialization remains compatible.

See https://github.com/ethereum/consensus-specs/pull/3190
and https://github.com/ethereum/beacon-APIs/pull/287
2023-01-13 16:46:35 +01:00
Jacek Sieka ba3db7aa5a
spec: Option -> Opt () 2023-01-11 12:29:21 +00:00
tersec 110401394b
consolidate consensus spec transition test fixtures ()
* consolidate consensus spec transition test fixtures

* include capella

* consoliate fork test fixtures

* note change in EIP-4844 process_block in alpha.2
2022-12-15 22:51:04 +00:00
tersec bb4ea37baa
update EF consensus spec URLs from v1.3.0-alpha.1 to v1.3.0-alpha.2 () 2022-12-15 12:15:12 +00:00
tersec 7faef7827e
fix EIP4844 withBlck ()
* fix EIP4844 withBlck

* don't raiseAssert by default
2022-12-14 18:30:56 +01:00
tersec ebca6879c6
consolidate block sanity tests across forks () 2022-12-14 08:42:25 +01:00