341 Commits

Author SHA1 Message Date
Nazar Hussain
5c359f92dc deps: migrate to biomejs from eslint (#7108)
* Replace eslint with biomejs

* Update the inclusion of word

* Fix the formatting

* Update the lint task to do all checks

* Update biome rules from eslint config

* Replace eslint with biomejs

* Update the inclusion of word

* Fix the formatting

* Update the lint task to do all checks

* Update biome rules from eslint config

* Fix all lint issues

* Fix formatting

* Add extension recomendation for vscode

* Enable recommended rules

* Enable rule noUselessSwitchCase

* Enable rule noUselessConstructor

* Fix the types

* Fix unit tests

* Enforce import extensions

* Update the cli command

* Enforce useConsistentMemberAccessibility

* Update rules

* Fix rules

* Upgrade biomejs to latest version

* Update the rules

* Update and format the config file

* Fix types break during merge

* Fix unused check

* Add comment for explicit-return-type

* Remove eslint file

* Add _e objects for empty catch blocks

* Update formatter config

* Fix formatting
2024-10-10 12:43:36 -04:00
NC
f2b96ff008 fix: include skipped partial withdrawal to partialWithdrawalsCount (#7118)
Include skipped partial withdrawal to count
2024-10-08 15:08:26 -07:00
Nico Flaig
bf607863e1 chore: remove signing domain for consolidations (#7092) 2024-09-25 13:39:48 -07:00
Nico Flaig
0dceb831ca chore: clean up from electra review (#7102) 2024-09-23 17:35:45 +01:00
Matthew Keil
cd98c23768 feat: async shuffling refactor (#6938)
* feat: add ShufflingCache to EpochCache

* fix: implementation in state-transition for EpochCache with ShufflingCache

* feat: remove shufflingCache.processState

* feat: implement ShufflingCache changes in beacon-node

* feat: pass shufflingCache when loading cached state from db

* test: fix state-transition tests for EpochCache changes

* feat: Pass shufflingCache to EpochCache at startup

* test: fix slot off by one for decision root in perf test

* chore: use ?. syntax

* chore: refactoring

* feat: add comments and clean up afterProcessEpoch

* fix: perf test slot incrementing

* fix: remove MockShufflingCache

* Revert "chore: refactoring"

This reverts commit 104aa56d84ce3ca33d045705591767ef578dec3a.

* refactor: shufflingCache getters

* refactor: shufflingCache setters

* refactor: build and getOrBuild

* docs: add comments to ShufflingCache methods

* chore: lint issues

* test: update tests in beacon-node

* chore: lint

* feat: get shufflings from cache for API

* feat: minTimeDelayToBuildShuffling cli flag

* test: fix shufflingCache promise insertion test

* fix: rebase conflicts

* fix: changes from debugging sim tests

* refactor: minimize changes in afterProcessEpoch

* chore: fix lint

* chore: fix check-types

* chore: fix check-types

* feat: add diff utility

* fix: bug in spec tests from invalid nextActiveIndices

* refactor: add/remove comments

* refactor: remove this.activeIndicesLength from EpochCache

* refactor: simplify shufflingCache.getSync

* refactor: remove unnecessary undefined's

* refactor: clean up ShufflingCache unit test

* feat: add metrics for ShufflingCache

* feat: add shufflingCache metrics to state-transition

* chore: lint

* fix: metric name clash

* refactor: add comment about not having ShufflingCache in EpochCache

* refactor: rename shuffling decision root functions

* refactor: remove unused comment

* feat: async add nextShuffling to EpochCache after its built

* feat: make ShufflingCache.set private

* feat: chance metrics to nextShufflingNotOnEpochCache instead of positive case

* refactor: move diff to separate PR

* chore: fix tests using shufflingCache.set method

* feat: remove minTimeDelayToBuild

* feat: return promise from insertPromise and then through build

* fix: update metrics names and help field

* feat: move build of shuffling to beforeProcessEpoch

* feat: allow calc of pivot slot before slot increment

* fix: calc of pivot slot before slot increment

* Revert "fix: calc of pivot slot before slot increment"

This reverts commit 5e65f7efa8.

* Revert "feat: allow calc of pivot slot before slot increment"

This reverts commit ed850ee0ce.

* feat: allow getting current block root for shuffling calculation

* fix: get nextShufflingDecisionRoot directly from state.blockRoots

* fix: convert toRootHex

* docs: add comment about pulling decisionRoot directly from state

* feat: add back metrics for regen attestation cache hit/miss

* docs: fix docstring on shufflingCache.build

* refactor: change validatorIndices to Uint32Array

* refactor: remove comment and change variable name

* fix: use toRootHex instead of toHexString

* refactor: deduplicate moved function computeAnchorCheckpoint

* fix: touch up metrics per PR comments

* fix: merge conflict

* chore: lint

* refactor: add scope around activeIndices to GC arrays

* feat: directly use Uint32Array instead of transcribing number array to Uint32Array

* refactor: activeIndices per tuyen comment

* refactor: rename to epochAfterNext

* chore: review PR

* feat: update no shuffling ApiError to 500 status

* fix: add back unnecessary eslint directive. to be remove under separate PR

* feat: update no shuffling ApiError to 500 status

* docs: add comment about upcomingEpoch

---------

Co-authored-by: Cayman <caymannava@gmail.com>
Co-authored-by: Tuyen Nguyen <vutuyen2636@gmail.com>
2024-09-23 08:41:47 +07:00
Matthew Keil
bb40ef7eb7 feat: add electra support for light-client (#7063)
* Add constant

* Use constants

* Remove ZERO_NEXT_SYNC_COMMITTEE_BRANCH

* Add normalizeMerkleBranch

* add getId to CheckpointHeaderRepository

* fix: light-client unit tests

* chore: lint

* Fix normalizeMerkleBranch

* Enable LC spec test

* fix spec test

---------

Co-authored-by: NC <17676176+ensi321@users.noreply.github.com>
2024-09-18 12:09:07 -07:00
Phil Ngo
25837f61fe Merge branch 'stable' into unstable 2024-09-17 14:45:18 -04:00
NC
e5cda9caf1 Update packages/beacon-node/src/chain/validation/aggregateAndProof.ts
Co-authored-by: Cayman <caymannava@gmail.com>

Update packages/types/src/utils/typeguards.ts

Co-authored-by: Cayman <caymannava@gmail.com>

Partial address comment

Partial address comment

Co-authored-by: Cayman <caymannava@gmail.com>
2024-08-27 20:14:37 +05:30
harkamal
371e962b95 chore: rebase fixes
lint

lint and type fix

update spec version

fix tests

fix spec test

Update packages/beacon-node/src/chain/stateCache/types.ts

Co-authored-by: Cayman <caymannava@gmail.com>

Update packages/beacon-node/src/chain/stateCache/types.ts

Co-authored-by: Cayman <caymannava@gmail.com>

Update packages/beacon-node/src/chain/blocks/types.ts

Co-authored-by: Cayman <caymannava@gmail.com>

Update packages/types/src/utils/typeguards.ts

Co-authored-by: Cayman <caymannava@gmail.com>

Variable naming

fix the ForkElectra

fix build

fix spec test

Co-authored-by: Cayman <caymannava@gmail.com>
2024-08-27 20:14:37 +05:30
harkamal
3a98b2f026 fix: electra rebase fixes on the allforks type refactor
tests fixes
2024-08-27 20:14:37 +05:30
harkamal
1d9c3a3a7d fix: electra rebase fixes on the new generic typing model
lint & type fix

lint
2024-08-27 20:14:37 +05:30
NC
39edbfdfcd feat: add EL triggered consolidation and remove ExecutionLayer prefix (#6865)
* init commit

* Add consolidation request

* fix lint

* Remove ExecutionLayer prefix

* Address comment

* Fix verification logic

* lint

* Add todo
2024-08-27 20:14:37 +05:30
Nico Flaig
f0eab386df test: fix ssz_static spec tests for all forks (#6771) 2024-08-27 20:14:37 +05:30
Navie Chan
9bd982cbfa Fix ssz_static 2024-08-27 20:14:37 +05:30
NC
a0fff8f4eb fix: fix e2e test in electra-fork (#6751)
Update spec version
2024-08-27 20:14:37 +05:30
NC
244dc88b0a feat: implement maxEB EIP-7251 (#6539)
* feat: implement EIP-6110 (#6042)

* Add immutable in the dependencies

* Initial change to pubkeyCache

* Added todos

* Moved unfinalized cache to epochCache

* Move populating finalized cache to afterProcessEpoch

* Specify unfinalized cache during state cloning

* Move from unfinalized to finalized cache in afterProcessEpoch

* Confused myself

* Clean up

* Change logic

* Fix cloning issue

* Clean up redundant code

* Add CarryoverData in epochCtx.createFromState

* Fix typo

* Update usage of pubkeyCache

* Update pubkeyCache usage

* Fix lint

* Fix lint

* Add 6110 to ChainConfig

* Add 6110 to BeaconPreset

* Define 6110 fork and container

* Add V6110 api to execution engine

* Update test

* Add depositReceiptsRoot to process_execution_payload

* State transitioning to EIP6110

* State transitioning to EIP6110

* Light client change in EIP-6110

* Update tests

* produceBlock

* Refactor processDeposit to match the spec

* Implement processDepositReceipt

* Implement 6110 fork guard for pubkeyCache

* Handle changes in eth1 deposit

* Update eth1 deposit test

* Fix typo

* Lint

* Remove embarassing comments

* Address comments

* Modify applyDeposit signature

* Update packages/state-transition/src/cache/epochCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Update packages/state-transition/src/cache/epochCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Update packages/state-transition/src/cache/pubkeyCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Remove old code

* Rename fields in epochCache and immutableData

* Remove CarryoverData

* Move isAfter6110 from var to method

* Fix cyclic import

* Fix operations spec runner

* Fix for spec test

* Fix spec test

* state.depositReceiptsStartIndex to BigInt

* getDeposit requires cached state

* default depositReceiptsStartIndex value in genesis

* Fix pubkeyCache bug

* newUnfinalizedPubkeyIndexMap in createCachedBeaconState

* Lint

* Pass epochCache instead of pubkey2IndexFn in apis

* Address comments

* Add unit test on pubkey cache cloning

* Add unfinalizedPubkeyCacheSize to metrics

* Add unfinalizedPubkeyCacheSize to metrics

* Clean up code

* Add besu to el-interop

* Add 6110 genesis file

* Template for sim test

* Add unit test for getEth1DepositCount

* Update sim test

* Update besudocker

* Finish beacon api calls in sim test

* Update epochCache.createFromState()

* Fix bug unfinalized validators are not finalized

* Add sim test to run a few blocks

* Lint

* Merge branch 'unstable' into 611

* Add more check to sim test

* Update besu docker image instruction

* Update sim test with correct tx

* Address comment + cleanup

* Clean up code

* Properly handle promise rejection

* Lint

* Update packages/beacon-node/src/execution/engine/types.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Update comments

* Accept type undefined in ExecutionPayloadBodyRpc

* Update comment and semantic

* Remove if statement when adding finalized validator

* Comment on repeated insert on finalized cache

* rename createFromState

* Add comment on getPubkey()

* Stash change to reduce diffs

* Stash change to reduce diffs

* Lint

* addFinalizedPubkey on finalized checkpoint

* Update comment

* Use OrderedMap for unfinalized cache

* Pull out logic of deleting pubkeys for batch op

* Add updateUnfinalizedPubkeys in regen

* Update updateUnfinalizedPubkeys logic

* Add comment

* Add metrics for state context caches

* Address comment

* Address comment

* Deprecate eth1Data polling when condition is reached

* Fix conflicts

* Fix sim test

* Lint

* Fix type

* Fix test

* Fix test

* Lint

* Update packages/light-client/src/spec/utils.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Fix spec test

* Address comments

* Improve cache logic on checkpoint finalized

* Update sim test according to new cache logic

* Update comment

* Lint

* Finalized pubkey cache only update once per checkpoint

* Add perf test for updateUnfinalizedPubkeys

* Add perf test for updateUnfinalizedPubkeys

* Tweak params for perf test

* Freeze besu docker image version for 6110

* Add benchmark result

* Use Map instead of OrderedMap. Update benchmark

* Minor optimization

* Minor optimization

* Add memory test for immutable.js

* Update test

* Reduce code duplication

* Lint

* Remove try/catch in updateUnfinalizedPubkeys

* Introduce EpochCache metric

* Add historicalValidatorLengths

* Polish code

* Migrate state-transition unit tests to vitest

* Fix calculation of pivot index

* `historicalValidatorLengths` only activate post 6110

* Update sim test

* Lint

* Update packages/state-transition/src/cache/epochCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Improve readability on historicalValidatorLengths

* Update types

* Fix calculation

* Add eth1data poll todo

* Add epochCache.getValidatorCountAtEpoch

* Add todo

* Add getStateIterator for state cache

* Partial commit

* Update perf test

* updateUnfinalizedPubkeys directly modify states from regen

* Update sim test. Lint

* Add todo

* some improvements and a fix for effectiveBalanceIncrements fork safeness

* rename eip6110 to elctra

* fix electra-interop.test.ts

---------

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>
Co-authored-by: gajinder <develop@g11tech.io>

lint and tsc

small cleanup

fix rebase issue

* feat: implement EIP-6110 (#6042)

* Add immutable in the dependencies

* Initial change to pubkeyCache

* Added todos

* Moved unfinalized cache to epochCache

* Move populating finalized cache to afterProcessEpoch

* Specify unfinalized cache during state cloning

* Move from unfinalized to finalized cache in afterProcessEpoch

* Confused myself

* Clean up

* Change logic

* Fix cloning issue

* Clean up redundant code

* Add CarryoverData in epochCtx.createFromState

* Fix typo

* Update usage of pubkeyCache

* Update pubkeyCache usage

* Fix lint

* Fix lint

* Add 6110 to ChainConfig

* Add 6110 to BeaconPreset

* Define 6110 fork and container

* Add V6110 api to execution engine

* Update test

* Add depositReceiptsRoot to process_execution_payload

* State transitioning to EIP6110

* State transitioning to EIP6110

* Light client change in EIP-6110

* Update tests

* produceBlock

* Refactor processDeposit to match the spec

* Implement processDepositReceipt

* Implement 6110 fork guard for pubkeyCache

* Handle changes in eth1 deposit

* Update eth1 deposit test

* Fix typo

* Lint

* Remove embarassing comments

* Address comments

* Modify applyDeposit signature

* Update packages/state-transition/src/cache/epochCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Update packages/state-transition/src/cache/epochCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Update packages/state-transition/src/cache/pubkeyCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Remove old code

* Rename fields in epochCache and immutableData

* Remove CarryoverData

* Move isAfter6110 from var to method

* Fix cyclic import

* Fix operations spec runner

* Fix for spec test

* Fix spec test

* state.depositReceiptsStartIndex to BigInt

* getDeposit requires cached state

* default depositReceiptsStartIndex value in genesis

* Fix pubkeyCache bug

* newUnfinalizedPubkeyIndexMap in createCachedBeaconState

* Lint

* Pass epochCache instead of pubkey2IndexFn in apis

* Address comments

* Add unit test on pubkey cache cloning

* Add unfinalizedPubkeyCacheSize to metrics

* Add unfinalizedPubkeyCacheSize to metrics

* Clean up code

* Add besu to el-interop

* Add 6110 genesis file

* Template for sim test

* Add unit test for getEth1DepositCount

* Update sim test

* Update besudocker

* Finish beacon api calls in sim test

* Update epochCache.createFromState()

* Fix bug unfinalized validators are not finalized

* Add sim test to run a few blocks

* Lint

* Merge branch 'unstable' into 611

* Add more check to sim test

* Update besu docker image instruction

* Update sim test with correct tx

* Address comment + cleanup

* Clean up code

* Properly handle promise rejection

* Lint

* Update packages/beacon-node/src/execution/engine/types.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Update comments

* Accept type undefined in ExecutionPayloadBodyRpc

* Update comment and semantic

* Remove if statement when adding finalized validator

* Comment on repeated insert on finalized cache

* rename createFromState

* Add comment on getPubkey()

* Stash change to reduce diffs

* Stash change to reduce diffs

* Lint

* addFinalizedPubkey on finalized checkpoint

* Update comment

* Use OrderedMap for unfinalized cache

* Pull out logic of deleting pubkeys for batch op

* Add updateUnfinalizedPubkeys in regen

* Update updateUnfinalizedPubkeys logic

* Add comment

* Add metrics for state context caches

* Address comment

* Address comment

* Deprecate eth1Data polling when condition is reached

* Fix conflicts

* Fix sim test

* Lint

* Fix type

* Fix test

* Fix test

* Lint

* Update packages/light-client/src/spec/utils.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Fix spec test

* Address comments

* Improve cache logic on checkpoint finalized

* Update sim test according to new cache logic

* Update comment

* Lint

* Finalized pubkey cache only update once per checkpoint

* Add perf test for updateUnfinalizedPubkeys

* Add perf test for updateUnfinalizedPubkeys

* Tweak params for perf test

* Freeze besu docker image version for 6110

* Add benchmark result

* Use Map instead of OrderedMap. Update benchmark

* Minor optimization

* Minor optimization

* Add memory test for immutable.js

* Update test

* Reduce code duplication

* Lint

* Remove try/catch in updateUnfinalizedPubkeys

* Introduce EpochCache metric

* Add historicalValidatorLengths

* Polish code

* Migrate state-transition unit tests to vitest

* Fix calculation of pivot index

* `historicalValidatorLengths` only activate post 6110

* Update sim test

* Lint

* Update packages/state-transition/src/cache/epochCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Improve readability on historicalValidatorLengths

* Update types

* Fix calculation

* Add eth1data poll todo

* Add epochCache.getValidatorCountAtEpoch

* Add todo

* Add getStateIterator for state cache

* Partial commit

* Update perf test

* updateUnfinalizedPubkeys directly modify states from regen

* Update sim test. Lint

* Add todo

* some improvements and a fix for effectiveBalanceIncrements fork safeness

* rename eip6110 to elctra

* fix electra-interop.test.ts

---------

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>
Co-authored-by: gajinder <develop@g11tech.io>

lint and tsc

small cleanup

* Add presets

* Update config

* Add necessary containers

* Update presets

* Update config

* Add todo comments

* Update constants and params

* Impl new process withdrawal

* Add withdrawaRequests to payload

* Add processConsolidation

* Add process withdraw request

* Update deposit and withdrawal flow

* epoch processing

* Implement churn limits

* Lint

* lint

* Update state-transition utils

* processExecutionLayerWithdrawRequest

* processConsolidation

* queueExcessActiveBalance

* isValidDepositSignature

* Add jsdoc and timer for new processEpoch functions

* Lint

* Update maxEB

* update voluntary exit

* Fix config

* Update initiateValidatorExit

* Remove churn limit in processRegistryUpdates

* Fix conflict

* Add MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD

* Reflect latest spec changes

* rebase fixes, fixes, improvements and cleanup

lint

* Upgrade ssz version

* Use sliceFrom()

* cleanup as per specs feedback

subarry

* simplify

* fix withdrawals

* remove slice

* fix the slashing quotient determination in slashvalidator

---------

Co-authored-by: harkamal <gajinder@g11.in>
2024-08-27 20:14:37 +05:30
g11tech
8db4adaecb feat: upgrade 7002 exits to withdrawal request (#6736)
* feat: upgrade 7002 exits to withdrawal request

* fix types

* fix types and references

* further fix the types references and get build passing

* update the process ops fn but needs to be extended by maxeb
2024-08-27 20:14:37 +05:30
NC
bef3eff3ac feat: add presets and ssz types for EIP-7549 (#6715)
* Add types

* Update unit test

* lint

* Address comments

* Address comments

* Lint

* Update packages/beacon-node/src/util/sszBytes.ts

Co-authored-by: tuyennhv <tuyen@chainsafe.io>

* Add isElectraAttestation

* Update unit test

* Update unit test

* chore: add comments for sszBytes.ts

---------

Co-authored-by: tuyennhv <tuyen@chainsafe.io>
Co-authored-by: Tuyen Nguyen <vutuyen2636@gmail.com>
Co-authored-by: Gajinder <develop@g11tech.io>
2024-08-27 20:14:37 +05:30
g11tech
4b707a9c8b feat: implement execution layer exits eip 7002 (#6651)
* feat: implement execution layer exits eip 7002

* lint and tsc fix

* apply feedback

* improve comment
2024-08-27 20:14:37 +05:30
NC
7f3ede7c01 feat: implement EIP-6110 (#6042)
* Add immutable in the dependencies

* Initial change to pubkeyCache

* Added todos

* Moved unfinalized cache to epochCache

* Move populating finalized cache to afterProcessEpoch

* Specify unfinalized cache during state cloning

* Move from unfinalized to finalized cache in afterProcessEpoch

* Confused myself

* Clean up

* Change logic

* Fix cloning issue

* Clean up redundant code

* Add CarryoverData in epochCtx.createFromState

* Fix typo

* Update usage of pubkeyCache

* Update pubkeyCache usage

* Fix lint

* Fix lint

* Add 6110 to ChainConfig

* Add 6110 to BeaconPreset

* Define 6110 fork and container

* Add V6110 api to execution engine

* Update test

* Add depositReceiptsRoot to process_execution_payload

* State transitioning to EIP6110

* State transitioning to EIP6110

* Light client change in EIP-6110

* Update tests

* produceBlock

* Refactor processDeposit to match the spec

* Implement processDepositReceipt

* Implement 6110 fork guard for pubkeyCache

* Handle changes in eth1 deposit

* Update eth1 deposit test

* Fix typo

* Lint

* Remove embarassing comments

* Address comments

* Modify applyDeposit signature

* Update packages/state-transition/src/cache/epochCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Update packages/state-transition/src/cache/epochCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Update packages/state-transition/src/cache/pubkeyCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Remove old code

* Rename fields in epochCache and immutableData

* Remove CarryoverData

* Move isAfter6110 from var to method

* Fix cyclic import

* Fix operations spec runner

* Fix for spec test

* Fix spec test

* state.depositReceiptsStartIndex to BigInt

* getDeposit requires cached state

* default depositReceiptsStartIndex value in genesis

* Fix pubkeyCache bug

* newUnfinalizedPubkeyIndexMap in createCachedBeaconState

* Lint

* Pass epochCache instead of pubkey2IndexFn in apis

* Address comments

* Add unit test on pubkey cache cloning

* Add unfinalizedPubkeyCacheSize to metrics

* Add unfinalizedPubkeyCacheSize to metrics

* Clean up code

* Add besu to el-interop

* Add 6110 genesis file

* Template for sim test

* Add unit test for getEth1DepositCount

* Update sim test

* Update besudocker

* Finish beacon api calls in sim test

* Update epochCache.createFromState()

* Fix bug unfinalized validators are not finalized

* Add sim test to run a few blocks

* Lint

* Merge branch 'unstable' into 611

* Add more check to sim test

* Update besu docker image instruction

* Update sim test with correct tx

* Address comment + cleanup

* Clean up code

* Properly handle promise rejection

* Lint

* Update packages/beacon-node/src/execution/engine/types.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Update comments

* Accept type undefined in ExecutionPayloadBodyRpc

* Update comment and semantic

* Remove if statement when adding finalized validator

* Comment on repeated insert on finalized cache

* rename createFromState

* Add comment on getPubkey()

* Stash change to reduce diffs

* Stash change to reduce diffs

* Lint

* addFinalizedPubkey on finalized checkpoint

* Update comment

* Use OrderedMap for unfinalized cache

* Pull out logic of deleting pubkeys for batch op

* Add updateUnfinalizedPubkeys in regen

* Update updateUnfinalizedPubkeys logic

* Add comment

* Add metrics for state context caches

* Address comment

* Address comment

* Deprecate eth1Data polling when condition is reached

* Fix conflicts

* Fix sim test

* Lint

* Fix type

* Fix test

* Fix test

* Lint

* Update packages/light-client/src/spec/utils.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Fix spec test

* Address comments

* Improve cache logic on checkpoint finalized

* Update sim test according to new cache logic

* Update comment

* Lint

* Finalized pubkey cache only update once per checkpoint

* Add perf test for updateUnfinalizedPubkeys

* Add perf test for updateUnfinalizedPubkeys

* Tweak params for perf test

* Freeze besu docker image version for 6110

* Add benchmark result

* Use Map instead of OrderedMap. Update benchmark

* Minor optimization

* Minor optimization

* Add memory test for immutable.js

* Update test

* Reduce code duplication

* Lint

* Remove try/catch in updateUnfinalizedPubkeys

* Introduce EpochCache metric

* Add historicalValidatorLengths

* Polish code

* Migrate state-transition unit tests to vitest

* Fix calculation of pivot index

* `historicalValidatorLengths` only activate post 6110

* Update sim test

* Lint

* Update packages/state-transition/src/cache/epochCache.ts

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>

* Improve readability on historicalValidatorLengths

* Update types

* Fix calculation

* Add eth1data poll todo

* Add epochCache.getValidatorCountAtEpoch

* Add todo

* Add getStateIterator for state cache

* Partial commit

* Update perf test

* updateUnfinalizedPubkeys directly modify states from regen

* Update sim test. Lint

* Add todo

* some improvements and a fix for effectiveBalanceIncrements fork safeness

* rename eip6110 to elctra

* fix electra-interop.test.ts

---------

Co-authored-by: Lion - dapplion <35266934+dapplion@users.noreply.github.com>
Co-authored-by: gajinder <develop@g11tech.io>

lint and tsc

small cleanup

fix rebase issue
2024-08-27 20:14:37 +05:30
harkamal
d87e637291 feat: placeholder PR for electra
add types stub and epoch config

fix types
2024-08-27 20:14:37 +05:30
Nico Flaig
6663684150 chore: post release updates (#7013) 2024-08-08 22:56:37 -04:00
Cayman
360fe779cd chore: bump package versions to 1.21.0 2024-08-06 16:58:51 -04:00
Phil Ngo
01fde1283f chore: bump package versions to 1.20.2 2024-07-19 07:55:30 -04:00
Cayman
71bcde86de chore: bump package versions to 1.20.1 2024-07-15 16:17:24 -04:00
Phil Ngo
b49beacb42 chore: bump package versions to 1.20.0 2024-07-09 11:54:24 -04:00
Nazar Hussain
f69bc110e4 chore: remove all* types objects (#6904)
* Remove all types

* Add unit tests

* Update the function name

* Update fork utility functions

* Cleanup utility usage

* Fix lint errors

* Fix types

* Update spec tests

* Update the types usage

* Fix the lint errors

* Update code as per feedback

* Update code as per feedback

* Fix lint errors

* Fix lint errors

* chore: fix type inference of exclude function (#6916)

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2024-06-27 21:19:07 +00:00
Nazar Hussain
802a875a73 refactor: improve types package to use forks as generics (#6825)
* Update the types to use generics

* Update the types with default generics

* Fix the block type

* Add missing type

* Add missing type

* Add ssz types

* Remove allForks namespace

* Make ssz types generic

* Update config package

* Fix blok fork types

* Fix api package types

* Update types

* Update state-transition package

* Update config package

* Fix types

* Fix types for all packages

* Update api package

* Fix types for tests files

* Fix ssz types

* Fix build error

* Fix lint errors

* Fix lint errors

* Fix type issues after rebase

* Update redundant generics

* Fix the type

* Update types to use single generic

* Fix all types

* Fix the code as per feedback

* Update the code with feedback

* Update packages/types/README.md

Co-authored-by: Nico Flaig <nflaig@protonmail.com>

* chore: review #6825 (#6887)

Review #6825

* Fix publishBlockWrapper input type

* Updated the type guard

* Remove ssz instance type

* Rename BlindedExecutionPayload to ExecutionPayloadheader

* Update code as per feedback

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2024-06-24 09:44:32 +02:00
Cayman
6c987446e3 chore: bump package versions to 1.19.0 2024-06-04 15:34:44 -04:00
Nazar Hussain
deafa4f162 chore: update nodejs to latest 22 (#6729)
* Upgrade node js version to 22

* Update node types

* Revert action config

* Add package from git hash

* Fix the build error

* Update the docs for node-22

* Update docker version for Nodejs to 22

* Update package.json

* Update package.json

Co-authored-by: Nico Flaig <nflaig@protonmail.com>

* Update readme docs

* Add word in dictionary

* Add word in dictionary

---------

Co-authored-by: Cayman <caymannava@gmail.com>
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2024-05-24 13:56:11 -04:00
Cayman
d0893ab817 Merge branch 'stable' into unstable 2024-05-13 05:08:21 -04:00
Phil Ngo
fe1e8c2b18 chore: bump package versions to 1.18.1 2024-05-13 03:25:35 -04:00
Nico Flaig
09e4b9c4e8 chore: update references to consensus spec to v1.4.0 (#6704)
* chore: update references to consensus spec to v1.4.0

* Remove unintended formatting changes
2024-04-24 15:20:54 -04:00
Cayman
71aea4b1c8 chore: bump package versions to 1.18.0 2024-04-23 14:32:10 -04:00
Phil Ngo
88b2564e4f v1.17.0 2024-03-08 10:39:20 -05:00
Nico Flaig
2f71c3284c chore: add eslint rule to prevent unused expressions (#6445)
* chore: add eslint rule to prevent unused expressions

* Fix unit tests
2024-02-22 16:59:25 -05:00
Cayman
fda3b19c4f v1.16.0 2024-02-20 13:16:26 -05:00
Nazar Hussain
da0bcc8f19 test: support .env.test to reuse env variables across the tests (#6408)
* Variables using .env file

* Add env variable support to normal tests

* Fix the order of variables

* Update the order of jobs

* Export the varible using actions toolkit

* Update the workflow tasks

* Fix the sim workflow

* Add .env.test file support to tests

* Fix the lint

* Update the task description

* Move lodestar preset to env file

* Fix the directory path

* newline

* Update debugging spec tests section

* Update the env variable for preset

* Fix the path for setup files

* Update code as per feedback

* Fix the e2e variables

* Update doc

* Fix the bash script

* Fix sim geth runne

* Update the env file

* Fix e2e tests

* Update the script tasks

* Update the script tasks

* Add minimal for e2e tests

* Add minimal for e2e tests

* Update comments in preset tests

* Downgrade nethermind version

* Load env file in e2e env

* Add the issue link in env variable

* Update bash script for failsafe current dir

* Fix the mistaken genesis extension for el nodes

* Add missing capella wait for one test

* Downgrade the geth version

* Update .env.test

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2024-02-12 14:36:33 +01:00
Cayman
6a479118cb chore: merge branch 'stable' into unstable 2024-02-07 11:00:26 -05:00
Phil Ngo
1857a49404 chore: v1.15.1 release (#6379)
* v1.15.1

* fix: ignore stale keystore lockfiles (#6363)

* fix: ignore stale keystore lockfiles

* Update error message if lockfile is already acquired

* Update keymanager lockfile e2e tests

* fix: ignore forkchoice invalidations if latestValidHash not found (#6361)

* fix: ignore forkchoice invalidations if latestValidHash not found

* rename for better understanding

* update the lvh search start index

* apply feedback

* fix: parse --blindedLocal flag value as boolean (#6403)

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
Co-authored-by: g11tech <develop@g11tech.io>
2024-02-07 08:39:24 -05:00
Julien
0db50b929b chore: improve browser support (#6384)
* fix: remove unsupported syntax

* fix: handle undefined process

* chore: remove uneeded type
2024-02-01 14:54:09 -05:00
Julien
ed43a988bf chore: align vitest config filenames (#6369) 2024-01-29 12:53:35 -05:00
Phil Ngo
d6a7a3982b chore: merge v1.15 stable back to unstable (#6372) 2024-01-29 09:48:52 -05:00
Julien
01d47b9a09 chore: align test scripts (#6339)
* chore: align yarn test scripts

* fix: handle prover stratup failure

* fix: lint

* chore: improve test guide

* chore: introduce top level download-spec-tests script

* chore: remove pretest scripts
2024-01-25 11:00:48 +01:00
Phil Ngo
92ed3479a6 v1.15.0 2024-01-23 11:06:39 -05:00
Nico Flaig
9b44056293 feat: update configs to be able to support Deneb on all networks (#6328)
* Move `MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS` from constants to config

* Align structure / comments with consensus spec

* Add references to preset / config files

* Rename directory and files that contain config values

* Add comment to networking params
2024-01-23 12:55:12 +05:30
Nazar Hussain
5b129f0f00 chore: cleanup mocha/chai/sinon usage across the repo (#6311)
* Cleanup mocha/chai usage

* Split the config files for each package

* Fix types

* Fix lint errors

* Sort the lint rules

* Fix types

* Cleanup sinon usage

* Fix tests

* Fix lint error

* Add vitest word to dictionary

* Fix the test iteration

* Fix e2e tests

* Sort the words

* Fix sim test assertion

* Fix data import

* Fix import order for mocks

* Fix import order

* Fix e2e tests

* Add contribution guide

* Fix the lint error

* Add src to dictionary

* Remove eslint-disable for skipped tests

* Fix assertions

* Update CONTRIBUTING.md

Co-authored-by: Matthew Keil <me@matthewkeil.com>

---------

Co-authored-by: Matthew Keil <me@matthewkeil.com>
2024-01-22 18:35:20 +01:00
Phil Ngo
02370a91e9 v1.14.0 2024-01-12 12:51:18 -05:00
g11tech
6f4a9d6f5e feat: implement blob sidecars with inclusion proof instead of signtaures (#6089)
modify the api

fix validator handling

fix val build

refactor the beacon node impl for the new blobs architecture

get the build working with no blobs

fix the blob sidecars transmisssion

relocate compute blob sidecars

relocate verify merkle branch

verify inclusion proof

fix tests and types

fix unit test

update the spec test versions

skip newly required merkle proof runner

change the minimal/mainnet preset based constant strategy

add other constants to tests

apply feedback

apply feedback

relocate utils
2023-12-25 14:54:00 +05:30
Nazar Hussain
fbdd1a474a test: migrate params tests to vitest (#6217)
* Migrate params tests to vitest

* Fix the assertion message
2023-12-21 17:34:38 +01:00