Commit Graph

1818 Commits

Author SHA1 Message Date
tersec 193a982d24
use EF consensus spec v1.5.0-alpha.6 test vectors (#6568)
* use EF consensus spec v1.5.0-alpha.6 test vectors

* LC changes are good as is, no need for the debug comment

* Fix indentation

* Use `execution_requests` for requests root

* fill in spec reference URLs for ExecutionPayload(Header)

* copy `execution_requests` when blidning blocks for Electra and add test

* fix `test_engine_api_conversions`

---------

Co-authored-by: Etan Kissling <etan@nimbus.team>
2024-09-20 21:32:16 +02:00
Etan Kissling 9df3d075de
fix blinded block conversion for Deneb and Electra (#6569)
`blob_gas_used` and `excess_blob_gas` were not copied on blinding
signed beacon block.
2024-09-20 16:02:24 +02:00
Eugene Kabanov e3fcd8b031
REST: getBlockRewards() and getSyncCommitteeRewards() implementation (#6556)
* Initial commit.

* Use temporary state instead of clearance.

* Attempt to fix `finalized`.

* Fix `genesis` response.

* Pre-calculate genesis block rewards response.

* Add implementation for sync committee rewards.

* Add total active balance calculation.

* Add genesis special case.

* Fix negative reward values.

* Address review comments.

* Fix isGenesis implementation and add REST test rules for both calls.
2024-09-18 23:34:32 +00:00
Agnish Ghosh 3f0d58492e
add: ssz consensus objs for peerdas (#6555) 2024-09-17 22:57:48 +00:00
Agnish Ghosh 1feeff4f92
add: recover matrix (#6553) 2024-09-17 10:21:55 +00:00
Agnish Ghosh b3c8c71776
add: compute matrix (#6550)
* add: compute matrix

* rm unsused imports

* rm unused imports 2

* rm bin

* rm unused line

* improve doc

* rid space on proc sig

* review 1

* added seeded PRNG

* randomize blob count as well, with smaller seed

* review 2
2024-09-16 11:19:34 +00:00
tersec 72b5c2bd6e
add some electra support to REST JSON decoding; rm unused code (#6549) 2024-09-15 13:33:13 +00:00
Pedro Miranda 7b6caebf6e
Add publishAggregateAndProofsV2 (#6546)
* added new endpoint version(v2) for validator aggregate and proof

* review improvements

* introduced nim template for proof executiion

---------

Co-authored-by: Pedro Miranda <pedro.miranda@nimbus.team>
2024-09-13 21:11:09 +00:00
tersec ed2422112c
resolve several outstanding items for Electra support; add debug-foo to light client yamux (#6547) 2024-09-13 10:07:06 +02:00
Agnish Ghosh f53b621818
add: `get_extended_sample_count` with test (#6544)
* add: get_extended_sample_count with test

* drop return

* reviews

* review fix

* fixed

* fix doc

* hooked to all_tests

* rm bin

* add updated test file

* early return, maybe need results?

* refactor function intricacies

* drop columnsCount
2024-09-12 17:55:16 +02:00
Agnish Ghosh a2a7cab76d
Rid result from `get_custody_column_subnets` (#6543)
* ditch results in get custody column subnets

* fix other part
2024-09-11 12:49:01 +02:00
tersec 1503c7dffe
rm some unused code/imports (#6541) 2024-09-11 05:45:37 +02:00
Pedro Miranda 1ac9b851b9
Add GetAggregateAttestation V2 endpoint version (#6511)
* attestation pool support and tests

* REST endpoints changes

* initial ncli and validator client support

* updated tests file

* fixed typos

* review improvements

* remove V1 endpoint

* revert v1 removal

* V2 endpoint version available to pre electra

---------

Co-authored-by: Pedro Miranda <pedro.miranda@nimbus.team>
2024-09-06 12:15:30 +00:00
Agnish Ghosh 444d1dd093
add: `get_custody_columns` for das_core (#6532)
* add: get_custody_columnns in das core specs with tests

* apply review changes

* review changes 2

* review 3
2024-09-04 16:05:18 +02:00
Agnish Ghosh 5a44e39e31
bump nim-kzg4844, enable ckzg2.0.0, fix whatever needed (#6502) 2024-09-02 11:47:00 +00:00
Etan Kissling 73be2af0d9
more concise RLP decoding syntax in EL helpers (#6514)
The comment in `readExecutionTransaction` is not actually relevant when
the `rlp.decode` template is called from a non-generic function.
The function still cannot be simply inlined; `is_valid_versioned_hashes`
is itself generic and would require an `export eth_types_rlp` to work
properly (generic sandwich issue). The non-generic function wrapper
seems simpler and avoids injecting RLP into importing modules.
2024-08-28 14:21:28 +02:00
tersec 8c2e8f2b0f
some v1.5.0-alpha.5 consensus spec URL updates (#6509) 2024-08-23 12:43:54 +02:00
Jacek Sieka 42c4ea109c
Revert "stop testing broken upstream version-2-0" (#6506)
* Revert "stop testing broken upstream version-2-0 (#6499)"

This reverts commit 2be7eba25a.

* fix field warning template
2024-08-23 12:18:06 +02:00
Etan Kissling a597fe95fa
check blob versioned hashes when no EL is connected (#6501)
* check blob versioned hashes when no EL is connected

When no EL is conencted, we have to at the very least ensure that the
data in the beacon block is consistent with the execution payload.
We already do this for the block hash, but also have to do it for the
`blob_kzg_commitments`. To validate that they are linked with the
execution payload, we have to RLP decode all EIP-4844 blob transactions
and compare their blob versioned hashes with the hashed commitments.

* simplify loop in case where `blob_versioned_hashes` doesn't exist

* skip blob transaction parsing pre Deneb
2024-08-22 06:04:03 +00:00
tersec 21aeeaf561
automated consensus spec URL updating to v1.5.0-alpha.5 (#6504) 2024-08-21 14:25:19 +02:00
tersec 485ed833e0
use EF consensus-specs v1.5.0-alpha.5 test vectors (#6503) 2024-08-21 12:18:33 +02:00
Etan Kissling b511f3eeb7
Use Pippenger multiplication for combining multiple sigs of same msg (#6484)
Newer `blst` releases expose multiscalar Pippenger multiplication that
allows accelerated verification of signatures pertaining to same msg.

- https://gist.github.com/wemeetagain/d52fc4b077f80db6e423935244c2afb2
2024-08-16 23:42:46 +02:00
tersec f258cba816
some v1.5.0-alpha.4 consensus spec URL updates (#6485) 2024-08-10 07:09:37 +02:00
tersec 904318cf83
automated consensus spec URL updating to v1.5.0-alpha.4 (#6483) 2024-08-09 18:24:49 +02:00
tersec 2e40a401b0
use EF consensus-specs v1.5.0-alpha.4 test vectors (#6482) 2024-08-09 15:02:04 +02:00
Etan Kissling 3375875e05
remove option to select Capella fork choice algo (#6478)
* remove option to select Capella fork choice algo

With Deneb having run stable for quite a while now, it's time to remove
the option to select the prior fork choice algo from Capella.

* also remove usage from test
2024-08-07 14:48:05 +00:00
Etan Kissling 51ca617d9f
fix LC header upgrade to Electra (#6473)
Followup on incorrect upgrade procedure in #6375 where `blob_gas_used`
was accidentally copied into `excess_blob_gas` when running Electra
`LightClientStore` with earlier `LightClient(Bootstrap|Update)`.
2024-08-06 15:48:15 +00:00
tersec c0fc0f41dd
calculate next slot's withdrawals properly even across epoch boundary (#6470) 2024-08-06 13:33:16 +02:00
tersec 8333365848
replace validator Bloom filter with partial bucket sort (#6469) 2024-08-02 07:30:22 +02:00
Etan Kissling 09f3882672
remove unsued `lcDataForkAtEpoch` helper (#6449)
`lcDataForkAtEpoch(.)` is not used anywhere and can be removed.
`lcDataForkAtConsensusFork(consensusForkAtEpoch(.))` saves same purpose.
2024-07-25 16:27:19 +02:00
tersec 15cca5f93e
hypergeometric distribution CDF for PeerDAS (#6447) 2024-07-25 01:59:24 +00:00
Etan Kissling a769550db5
rename LC gindex constants to match spec (#6444)
Use `_ELECTRA` suffix for gindex constants to match consensus-specs.
2024-07-23 20:20:15 +00:00
tersec ebd0217a10
fix is_eligible_for_activation_queue for electra (#6427) 2024-07-15 21:08:20 +02:00
tersec 3db571d182
allow individual calculation of validator balances across epoch boundaries (#6416) 2024-07-07 00:32:50 +02:00
andri lim 0b276315d2
Bump nim-eth: Convert GasInt to uint64 (#6415)
* Bump nim-eth: Convert GasInt to uint64

* Fixes

* Fix libnimbus_lc
2024-07-06 20:25:31 +00:00
Etan Kissling 7f59e80aaa
validate EL block hash in Electra when no EL is connected (#6407)
When no EL is connected, it is still required to validate the block hash
of `ExecutionPayload` to prevent attacks that trick us into attesting to
a circular chain with invalid in-between block hashes. This is already
done through Deneb but was still missing in Electra to be rectified now.
2024-07-05 10:18:50 +02:00
Eugene Kabanov 85c2850971
Fix publishBlockV1() and publishBlockV2() SSZ decoding process. (#6408) 2024-07-04 01:08:07 +00:00
Eugene Kabanov 84a35c85c5
Fix for gcc-14 issues in kzg-4844. (#6403)
* Bump nim-kzg4844.

* Fix code to use proper KZG types.

* Add missing coma.

* Fix compilation issue.

* Bump nim-kzg4844.

* Add debugging output.

* Remove debugging output.

* Restore groupBlobs function.
2024-07-03 10:01:33 +00:00
Etan Kissling 515bd486e6
ensure passing unsigned integer to `rlp.encode` (#6397)
RLP encoding is not defined for signed integers. Make sure to use
unsigned integers when encoding RLP for EL block hash computation.
2024-07-03 01:43:16 +00:00
Etan Kissling fba8cc3ee5
fix EIP reference in Electra type definition (#6398)
The field `withdrawal_requests` is from EIP-7002 instead of EIP-6110.
2024-07-03 01:41:01 +00:00
Etan Kissling 9924aec1e3
extend light client protocol for Electra (#6375)
* 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
Etan Kissling 3da85e593f
update references for LC related Nim issues (#6389)
Addresses feedback from #6375 that is applicable to pre-existing code
moreso than to the new PR.
2024-06-26 14:31:36 +02:00
tersec 9b6b42c8f9
some consensus spec URL updates to v1.5.0-alpha.3 (#6382) 2024-06-22 07:28:19 +02:00
Etan Kissling 22b5bc6256
cleanup Electra fork references (#6372)
Adjust two fork references to match surrounding code style.
2024-06-20 21:09:41 +02:00
tersec 350c4eaa39
rm Goerli remnant; add explanatory comment about opt sync validation (#6365) 2024-06-17 09:40:41 +00:00
tersec 88fa8b17ea
automated consensus spec URL updating to v1.5.0-alpha.3 (#6364) 2024-06-16 02:59:25 +02:00
tersec 0fab9682a6
use EF consensus-specs v1.5.0-alpha.3 test vectors (#6362) 2024-06-16 00:15:27 +02:00
tersec a93ab7cf3b
Revert "bump nim-kzg4844 for gcc-14 compatibility (#6342)" (#6360)
This reverts commit c5326619a4.
2024-06-14 23:23:19 +00:00
Eugene Kabanov c5326619a4
bump nim-kzg4844 for gcc-14 compatibility (#6342)
* Bump nim-kzg4844.

* Fix code to use proper KZG types.

* Add missing coma.

* Fix compilation issue.

* Bump nim-kzg4844.
2024-06-14 00:46:03 +00:00
andri lim fb0494e739
Bump nim-eth for revert GasInt back to int64 (#6347)
* Bump nim-eth for revert GasInt back to int64

* Fix libnimbus_lc
2024-06-13 15:25:59 +02:00