Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
541d640
chore: use tree view data pointers
wemeetagain Jan 8, 2026
0cdc10d
wip
wemeetagain Jan 8, 2026
587963b
fix: fix duplicate conflict syncCommitteeCache
GrapeBaBa Jan 9, 2026
e24495a
fix: fix missing pmt module in the state transition
GrapeBaBa Jan 9, 2026
adf0ccb
fix: add missing pool arg
GrapeBaBa Jan 9, 2026
3a36ba6
fix: fix generate_state test using treeview
GrapeBaBa Jan 9, 2026
60047f3
fix: fix seed isPostElectra migration
GrapeBaBa Jan 9, 2026
ba879cb
fix: fix beacon state get const ptr
GrapeBaBa Jan 9, 2026
ee58135
fix: fix generate_state test using setValue and getAllInto
GrapeBaBa Jan 9, 2026
9ddcb52
fix: fix fork epoch in the generate state
GrapeBaBa Jan 9, 2026
6807f23
fix: fix error union mismatch
GrapeBaBa Jan 9, 2026
2c10c6c
feat: add getAllReadonlyValues for array/list tree view
GrapeBaBa Jan 9, 2026
781d24f
fix: fix epoch cache get validators
GrapeBaBa Jan 9, 2026
2348644
fix: fix epoch cache issue
GrapeBaBa Jan 9, 2026
8ba1771
fix: fix several using tree view error
GrapeBaBa Jan 9, 2026
128b266
fix: processSlashings
wemeetagain Jan 9, 2026
76fa3c3
fix: processRewardsAndPenalties
wemeetagain Jan 9, 2026
5e8fcc6
fix: processRegistryUpdates
wemeetagain Jan 9, 2026
96bb17b
fix: processRandaoMixesReset
wemeetagain Jan 9, 2026
da46fde
fix: partially fix processProposerLookahead
wemeetagain Jan 9, 2026
cd5b954
fix: more processProposerLookahead
wemeetagain Jan 9, 2026
a0d7dd5
Merge remote-tracking branch 'origin/main' into tree-view-state
wemeetagain Jan 10, 2026
68a1b85
feat: add ListTreeView.iteratorReadonly
wemeetagain Jan 12, 2026
b019231
fix: processPendingDeposits
wemeetagain Jan 12, 2026
60fc413
fix: add electra/fulu in beacon execution payload
GrapeBaBa Jan 12, 2026
e2fb0aa
fix: fix beacon state test
GrapeBaBa Jan 12, 2026
524d58f
fix: fix state transition block
GrapeBaBa Jan 12, 2026
c4208b6
fix: fix state transition block issue
GrapeBaBa Jan 12, 2026
936ec93
fix: processPendingConsolidations
wemeetagain Jan 12, 2026
d1ad229
fix: processParticipationFlagUpdates
wemeetagain Jan 12, 2026
28b79ee
fix: processJustificationAndFinalization
wemeetagain Jan 12, 2026
0ac1ca0
fix: processInactivityUpdates
wemeetagain Jan 12, 2026
d353978
fix: processHistoricalSummariesUpdate
wemeetagain Jan 12, 2026
ad28b61
fix: processHistoricalRootsUpdate
wemeetagain Jan 12, 2026
02f2279
fix: processEth1DataReset
wemeetagain Jan 12, 2026
dfe5085
fix: processEffectiveBalanceUpdates
wemeetagain Jan 12, 2026
12602f5
fix: processEpoch
wemeetagain Jan 12, 2026
b59448f
feat: update TreeView.hashTreeRoot signature (return root const pointer)
wemeetagain Jan 12, 2026
27cefab
fix: stateTransition
wemeetagain Jan 12, 2026
619b003
fix: stray hashTreeRoot fixes
wemeetagain Jan 12, 2026
ddf127d
chore: remove interior mutability
wemeetagain Jan 12, 2026
7031c15
fix: start on sanity spec tests
wemeetagain Jan 12, 2026
22bf3c3
fix: fix state_transition test
GrapeBaBa Jan 13, 2026
fbd1dcf
fix: fix era treeview test
GrapeBaBa Jan 13, 2026
ef5c22f
fix: fix spec test unalign issue related to ownership
GrapeBaBa Jan 13, 2026
68d4a5f
fix: fix children nodes and datas cache not consistent
GrapeBaBa Jan 13, 2026
885f275
fix: fix skipped slots spec test
GrapeBaBa Jan 13, 2026
74c3e83
fix: remove debug log
GrapeBaBa Jan 13, 2026
b0ce31a
fix: various fixes
wemeetagain Jan 13, 2026
58f0cf8
fix: fix the phase0 epoch spec test
GrapeBaBa Jan 14, 2026
af8719b
fix: fix operation spec test
GrapeBaBa Jan 14, 2026
2b9582f
fix: fix finality spec test
GrapeBaBa Jan 14, 2026
5cce078
fix: fix random spec test
GrapeBaBa Jan 14, 2026
fe28bc6
fix: fix the phase0 fork spec test
GrapeBaBa Jan 14, 2026
f357119
fix: using setrootnode instead of transfer ownership
GrapeBaBa Jan 14, 2026
6f2294d
fix: fix altiar spec test
GrapeBaBa Jan 14, 2026
bd62993
fix: more spec test fixes
wemeetagain Jan 14, 2026
aad9fea
fix: simplify tree view semantics
wemeetagain Jan 14, 2026
c9527ae
fix: add TreeView.getReadonly behavior
wemeetagain Jan 14, 2026
03acfe3
fix: fixup becomesNewEth1Data
wemeetagain Jan 14, 2026
1b344f9
fix: bench_process_block
wemeetagain Jan 14, 2026
3a87de4
Merge branch 'main' into tree-view-state
GrapeBaBa Jan 15, 2026
e3303b4
fix: fix tests
GrapeBaBa Jan 15, 2026
caea327
refactor: make bench process epoch works
GrapeBaBa Jan 15, 2026
dbcd8c2
fix: fix lint
GrapeBaBa Jan 15, 2026
f034c58
fix: remove stray constCasts
wemeetagain Jan 15, 2026
ee69250
chore: use DebugAllocator in benchmarks
wemeetagain Jan 15, 2026
e1b9275
fix: illegal instruction
wemeetagain Jan 15, 2026
7464392
chore: minor tweaks
wemeetagain Jan 15, 2026
818e484
chore: commit state if verify_state_root = false
wemeetagain Jan 15, 2026
d273827
fix: slot check in processSlots
wemeetagain Jan 15, 2026
8f27a4c
chore: rename processSlots
wemeetagain Jan 15, 2026
9fb83a5
chore: fix bls wrapper test
wemeetagain Jan 15, 2026
b32673c
feat: add napi bindings
wemeetagain Jan 15, 2026
2f36266
chore: pr review
wemeetagain Jan 15, 2026
0ae9295
chore: simplify pubkey handling and PubkeyIndexMap
wemeetagain Jan 15, 2026
2046fc7
chore: add pubkey index caches
wemeetagain Jan 15, 2026
ac58feb
chore: add config binding
wemeetagain Jan 15, 2026
1bd2562
chore: simplify us of singletons
wemeetagain Jan 15, 2026
5b1a961
chore: apply suggestions from code review
wemeetagain Jan 16, 2026
f7ee63b
fix: build errors
wemeetagain Jan 16, 2026
8990d8c
feat: rotateSyncCommittees
wemeetagain Jan 16, 2026
467e5ca
chore: more pr review
wemeetagain Jan 16, 2026
ad8b6ce
feat: add ssz.Type.default_root
wemeetagain Jan 9, 2026
bfd0c6a
feat: add ST.tree.default and ListST.tree.zeros
wemeetagain Jan 16, 2026
4e4dc56
chore: use EpochParticipation.tree.zeros to rotate epoch participation
wemeetagain Jan 16, 2026
7acc7d0
feat: BeaconState.balancesSlice
wemeetagain Jan 16, 2026
88d4f51
chore: remove allocator from processConsolidationRequest
wemeetagain Jan 16, 2026
30d8cca
chore: clean up processRandao
wemeetagain Jan 16, 2026
e66590c
chore: clean up BeaconState.populateFields
wemeetagain Jan 16, 2026
ac05476
chore: remove stale comment
wemeetagain Jan 16, 2026
12d3082
fix: errdefer remove dangling undefined in BaseTreeView.getChildDataR…
wemeetagain Jan 16, 2026
d10e670
chore: more comments on ListView.iteratorReadonly
wemeetagain Jan 16, 2026
0c70743
chore: use TreeView.getValue(out) pattern
wemeetagain Jan 16, 2026
be91097
chore: fix build errors
wemeetagain Jan 16, 2026
5dc07c3
Merge branch 'tree-view-state' into napi
wemeetagain Jan 16, 2026
b863222
chore: add BeaconStateView skeleton
wemeetagain Jan 16, 2026
9c93680
chore: more fixes
wemeetagain Jan 16, 2026
df8d08f
demo
wemeetagain Jan 16, 2026
1711695
Update bindings/napi/pubkey2index.zig
wemeetagain Jan 19, 2026
97f5c5a
Feat: add napi bindings for BeaconStateView getters (#177)
guha-rahul Jan 19, 2026
c06b9a0
Merge branch 'main' into napi
wemeetagain Jan 19, 2026
29295b4
chore: more cleanup
wemeetagain Jan 19, 2026
0cc6d3b
chore: add save/load of pubkeys
wemeetagain Jan 19, 2026
2c9a9cf
chore: rename beacon state view file
wemeetagain Jan 19, 2026
2516bb9
feat: add bindings for compute_proposer_index (#176)
guha-rahul Jan 21, 2026
50ed125
feat: napi with `innerShuffleList` (#174)
jeffoodchain Jan 22, 2026
b759023
feat: add new getters for pending deposits and withdrawals in BeaconS…
jeffoodchain Jan 26, 2026
5f2535d
feat: implement clonedCount, cloneCountWithTransferCache, and created…
jeffoodchain Jan 26, 2026
32350d2
feat: add new getters to BeaconStateView napi binding
jeffoodchain Jan 26, 2026
e3ee67c
feat: add serializeValidators
jeffoodchain Jan 26, 2026
9a873a7
refactor: change the order of serializeValidators
jeffoodchain Jan 26, 2026
f552891
feat: add serializedValidatorsSize
jeffoodchain Jan 26, 2026
89a8542
feat: add serializeValidatorsToBytes
jeffoodchain Jan 26, 2026
454eac8
fix: changing the field name from snake case to camel case
jeffoodchain Jan 27, 2026
8045c07
feat: binding beaconStateView getters (#182)
jeffoodchain Jan 28, 2026
cfc06cb
feat: add bindings for more getters for BeaconStateView (#189)
guha-rahul Jan 29, 2026
21a95cf
feat: blst bindings (#192)
spiral-ladder Jan 29, 2026
eacad3b
Merge branch 'main' into napi
wemeetagain Jan 29, 2026
461d661
Merge remote-tracking branch 'jeff/binding/beacon_state_view/getters_…
wemeetagain Jan 29, 2026
c724a26
chore: reorder and reorganize BeaconStateView
wemeetagain Jan 29, 2026
cea7110
chore: add syncPubkeysParallel
wemeetagain Jan 29, 2026
908fe19
chore: fix build errors
wemeetagain Jan 29, 2026
94b834b
chore: small cleanups
wemeetagain Jan 29, 2026
d8b02ca
refactor: extract napi_property_descriptro helpers (#201)
spiral-ladder Jan 30, 2026
5b9eb62
Merge branch 'main' into napi
wemeetagain Feb 2, 2026
e532ae6
chore: fix underflow
wemeetagain Feb 2, 2026
dc13d05
chore: small cleanup
wemeetagain Feb 2, 2026
2b096f5
chore: fix bench
wemeetagain Feb 2, 2026
524f21a
chore: remove proposer index binding
wemeetagain Feb 2, 2026
fa9d4e8
refactor: shuffling code
wemeetagain Feb 3, 2026
3bbd887
chore: add bindings productionization
wemeetagain Feb 3, 2026
b60ef9e
refactor(napi): derive fork instead of using from param in `BeaconSta…
spiral-ladder Feb 4, 2026
89e4b02
perf: improve napi bindings by direct serialization (#202)
guha-rahul Feb 5, 2026
f724240
chore: zbuild sync
wemeetagain Feb 5, 2026
1c0e8b6
feat(napi): extend blst bindings (#204)
spiral-ladder Feb 5, 2026
fe7af7b
chore: dontTransferCache -> transferCache
wemeetagain Feb 5, 2026
f07f276
chore: better comment
wemeetagain Feb 5, 2026
606f18c
chore: remove misc consensus types
wemeetagain Feb 5, 2026
ac9bbd9
Merge branch 'main' into napi
wemeetagain Feb 5, 2026
d03f2dd
feat: implement compact multi proofs and bindings for createMultiProo…
guha-rahul Feb 5, 2026
51f4c58
chore: add BeaconStateView unit test
wemeetagain Feb 5, 2026
f5c1144
pnpm biome fix
spiral-ladder Feb 6, 2026
81e836d
fmt fix again
spiral-ladder Feb 6, 2026
82f8d15
chore: fix more tests
wemeetagain Feb 6, 2026
ce2a184
fix: getEffectiveBalanceIncrements usage
spiral-ladder Feb 10, 2026
3ea0bb2
Download era files
spiral-ladder Feb 10, 2026
5f79d07
Increase timeout for hashTreeRoot test
spiral-ladder Feb 10, 2026
32df6ee
formatting
spiral-ladder Feb 10, 2026
ad3cd12
double timeout
spiral-ladder Feb 10, 2026
c38f47e
Revert "set max-old-space-size=8192"
spiral-ladder Feb 10, 2026
d0e7f21
test: comment out hashTreeRoot test
spiral-ladder Feb 10, 2026
8e5daf2
tweak alloc
spiral-ladder Feb 10, 2026
e43fae8
Revert "destructure lodestarState"
spiral-ladder Feb 11, 2026
64435f3
try gc
spiral-ladder Feb 11, 2026
dc72a62
restore era files CI
spiral-ladder Feb 11, 2026
c92e3fc
gc
spiral-ladder Feb 11, 2026
864b53d
fix: effectiveBalanceIncrementsSet did not copy over old data
spiral-ladder Feb 11, 2026
4eb3d86
refactor: effective balance increments
spiral-ladder Feb 11, 2026
494b3c7
Apply suggestion from @wemeetagain
wemeetagain Feb 11, 2026
a828e94
chore: fix index2pubkey, add sanity unit tests
wemeetagain Feb 12, 2026
c03c80b
chore: remove globalThis.blst in favor of zig-tracked ref
wemeetagain Feb 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ concurrency:

env:
ZIG_VERSION: "0.14.1"
NODE_VERSION: "24"

jobs:
zbuild:
Expand Down Expand Up @@ -223,3 +224,42 @@ jobs:
- name: Run spec tests - mainnet
run: |
zig build test:spec_tests -Dpreset=mainnet

bindings-test:
name: bindings - test
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install dependencies
run: |
pnpm install
- name: Run bindings formatter
run: |
pnpm biome ci
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
cache-key: ubuntu-latest-${{ env.ZIG_VERSION }}
- name: Build bindings
run: |
zig build build-lib:bindings
- name: Restore era files cache
uses: actions/cache@v4
with:
path: fixtures/era
key: era-files-${{ hashFiles('build.zig') }} # downloaded era files defined in build.zig
- name: Download era files
run: |
zig build run:download_era_files
- name: Test bindings
run: |
pnpm test
39 changes: 39 additions & 0 deletions .github/workflows/publish-bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish NAPI Bindings
on:
workflow_dispatch:

env:
ZIG_VERSION: "0.14.1"
NODE_VERSION: "24"

jobs:
publish-bindings:
name: publish bindings
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install dependencies
run: |
pnpm install
- name: Run bindings formatter
run: |
pnpm biome ci
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: ${{ env.ZIG_VERSION }}
cache-key: ubuntu-latest-${{ env.ZIG_VERSION }}
- name: Build and publish to npm
run: |
pnpm zapi build-artifacts --optimize ReleaseSafe
pnpm zapi prepublish
pnpm zapi publish --access public

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ test/spec/test_case/
test/spec/ssz/generic_tests.zig
test/spec/ssz/static_tests.zig
*.era
*.pkix

# perf
flamegraph.html
perf.data
perf.data.old

# js
node_modules/
9 changes: 4 additions & 5 deletions bench/state_transition/process_block.zig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const BeaconBlock = fork_types.BeaconBlock;
const BeaconBlockBody = fork_types.BeaconBlockBody;
const AnyBeaconState = fork_types.AnyBeaconState;
const ValidatorIndex = types.primitive.ValidatorIndex.Type;
const PubkeyIndexMap = state_transition.PubkeyIndexMap(ValidatorIndex);
const Withdrawals = types.capella.Withdrawals.Type;
const WithdrawalsResult = state_transition.WithdrawalsResult;
const BlockExternalData = state_transition.BlockExternalData;
Expand Down Expand Up @@ -513,7 +512,7 @@ fn runBenchmark(

const beacon_config = config.BeaconConfig.init(chain_config, (try beacon_state.?.genesisValidatorsRoot()).*);

const pubkey_index_map = try PubkeyIndexMap.init(allocator);
var pubkey_index_map = state_transition.PubkeyIndexMap.init(allocator);
defer pubkey_index_map.deinit();

const index_pubkey_cache = try allocator.create(state_transition.Index2PubkeyCache);
Expand All @@ -526,12 +525,12 @@ fn runBenchmark(
const validators = try beacon_state.?.validatorsSlice(allocator);
defer allocator.free(validators);

try state_transition.syncPubkeys(validators, pubkey_index_map, index_pubkey_cache);
try state_transition.syncPubkeys(validators, &pubkey_index_map, &index_pubkey_cache);

const cached_state = try CachedBeaconState.createCachedBeaconState(allocator, beacon_state.?, .{
.config = &beacon_config,
.index_to_pubkey = index_pubkey_cache,
.pubkey_to_index = pubkey_index_map,
.index_to_pubkey = &index_pubkey_cache,
.pubkey_to_index = &pubkey_index_map,
}, .{ .skip_sync_committee_cache = !comptime fork.gte(.altair), .skip_sync_pubkeys = false });
beacon_state = null;
defer {
Expand Down
9 changes: 4 additions & 5 deletions bench/state_transition/process_epoch.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const ForkSeq = config.ForkSeq;
const CachedBeaconState = state_transition.CachedBeaconState;
const EpochTransitionCache = state_transition.EpochTransitionCache;
const ValidatorIndex = types.primitive.ValidatorIndex.Type;
const PubkeyIndexMap = state_transition.PubkeyIndexMap(ValidatorIndex);
const slotFromStateBytes = @import("utils.zig").slotFromStateBytes;
const loadState = @import("utils.zig").loadState;

Expand Down Expand Up @@ -686,7 +685,7 @@ fn runBenchmark(

const beacon_config = config.BeaconConfig.init(chain_config, (try beacon_state.?.genesisValidatorsRoot()).*);

const pubkey_index_map = try PubkeyIndexMap.init(allocator);
var pubkey_index_map = state_transition.PubkeyIndexMap.init(allocator);
defer pubkey_index_map.deinit();

const index_pubkey_cache = try allocator.create(state_transition.Index2PubkeyCache);
Expand All @@ -699,12 +698,12 @@ fn runBenchmark(
const validators = try beacon_state.?.validatorsSlice(allocator);
defer allocator.free(validators);

try state_transition.syncPubkeys(validators, pubkey_index_map, index_pubkey_cache);
try state_transition.syncPubkeys(validators, &pubkey_index_map, &index_pubkey_cache);

const immutable_data = state_transition.EpochCacheImmutableData{
.config = &beacon_config,
.index_to_pubkey = index_pubkey_cache,
.pubkey_to_index = pubkey_index_map,
.index_to_pubkey = &index_pubkey_cache,
.pubkey_to_index = &pubkey_index_map,
};

const cached_state = try CachedBeaconState.createCachedBeaconState(allocator, beacon_state.?, immutable_data, .{
Expand Down
Loading