Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0f06678
chore: remove merge transition code
markolazic01 May 14, 2026
599dfdb
fix: adapt bindings
markolazic01 May 14, 2026
940f16c
fix(build): remove `zig-out` from `files` (#360)
spiral-ladder May 15, 2026
675215d
feat(blst): use external buffers for blst operations (#358)
spiral-ladder May 16, 2026
8fbf38f
chore(release): 0.1.2-rc.2 (#365)
spiral-ladder May 16, 2026
3ce4390
feat: implement `loadState` API and binding (#165)
GrapeBaBa May 17, 2026
787ab66
chore: support dev workflow (#364)
wemeetagain May 19, 2026
2288018
fix: re-expose sizes (#369)
spiral-ladder May 19, 2026
6b149a7
chore: release v0.1.2-rc.3 (#370)
spiral-ladder May 19, 2026
fd96543
feat: support getLatestWeakSubjectivityCheckpointEpoch (#366)
spiral-ladder May 20, 2026
0aaabd3
fix: export asyncAggregateWithRandomness through napi binding (#371)
nazarhussain May 22, 2026
a417fd9
chore(deps): use zapi v2.1.0 (#372)
spiral-ladder May 22, 2026
4dffaeb
chore(release): v0.1.2-rc.4 (#373)
spiral-ladder May 22, 2026
0c6d3ad
chore(release): v0.1.2-rc.5 (#374)
spiral-ladder May 22, 2026
760dccc
chore(deps): bump zapi v2.1.0 -> v2.2.0 (#376)
spiral-ladder May 23, 2026
78a8427
chore(release): v0.1.2-rc.6 (#375)
spiral-ladder May 23, 2026
dc66acb
fix: improve atomic ordering in ThreadPool and NAPI init (#310)
GrapeBaBa May 25, 2026
67ebed4
fix(bindings): misordering of print for cpu count (#381)
spiral-ladder May 27, 2026
596aa1d
fix: harden memory safety across PMT, SSZ tree views, and state trans…
GrapeBaBa May 27, 2026
5196f67
chore: disable gemini auto code review (#382)
wemeetagain May 27, 2026
07652a8
chore: move state clones out of benchmark run functions (#324)
markolazic01 May 28, 2026
246aa29
refactor(bindings): wake only required number of workers (#383)
spiral-ladder May 29, 2026
fc4f1b8
feat: getSyncCommitteesWitness (#367)
spiral-ladder Jun 3, 2026
09a214f
fix: better generation of rand scalar (#388)
spiral-ladder Jun 6, 2026
7647102
fix(blst): default signature infinity check to true if not provided (…
spiral-ladder Jun 6, 2026
12dd46e
refactor: allocate `AsyncAggRandData` in one obj (#384)
spiral-ladder Jun 6, 2026
5837b0d
refactor(bls): remove single-threaded fallback (#390)
spiral-ladder Jun 6, 2026
53018d0
chore(deps): compile blst with ReleaseFast (#391)
spiral-ladder Jun 6, 2026
cd5e017
refactor(bls): remove need for tracking results for verifyMultipleAgg…
spiral-ladder Jun 6, 2026
8462c8f
perf(pmt): chunked-leaf packing for basic lists and container_struct …
GrapeBaBa Jun 9, 2026
ddbf084
fix(state-transition): repair Pool.init call broken by #346×#367 merg…
GrapeBaBa Jun 9, 2026
37181bd
refactor(bls): allocations around VMAS (#395)
spiral-ladder Jun 10, 2026
3f3e3b7
fix(bindings): size BLS thread pool by cgroup-aware CPU count (#386)
GrapeBaBa Jun 11, 2026
20a41a5
feat(bls): add small MSM for npoints < 32 (#393)
spiral-ladder Jun 12, 2026
eabd6fc
feat(bindings): aggregate cached public keys by validator index (#397)
spiral-ladder Jun 12, 2026
4d02bac
chore(release): v0.1.2-rc.8 (#401)
spiral-ladder Jun 12, 2026
08503f8
chore(deps): bump zbuild (#403)
spiral-ladder Jun 12, 2026
f0e6bc5
chore(release): v0.1.2-rc.9 (#404)
spiral-ladder Jun 12, 2026
c5681b4
refactor(bls): clean up bls (#398)
spiral-ladder Jun 16, 2026
f9f8a89
chore: update gloas types to align with the latest specs (#431)
ensi321 Jun 16, 2026
e73c6d4
fix: no-op when syncPubkeys run on a pk cache with shrinking validato…
spiral-ladder Jun 16, 2026
c5753a5
fix(pmt,ssz): harden chunked-leaf and zero-copy tree-view memory safe…
GrapeBaBa Jun 16, 2026
d8b795b
feat(bindings): align `BeaconStateView` with `IBeaconStateView` (#347)
spiral-ladder Jun 17, 2026
2276bc5
fix: various fixes around config (#433)
spiral-ladder Jun 17, 2026
eb609db
fix: re-apply merge code removal in a new file
markolazic01 Jun 17, 2026
8bbbb34
Merge branch 'main' into cleanup/remove-merge-transition-code
markolazic01 Jun 17, 2026
04a869a
fix: remove isMergeTransitionBlock
markolazic01 Jun 17, 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
4 changes: 1 addition & 3 deletions bindings/napi/transition_opts.zig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const st = @import("state_transition");
/// Recognized fields:
/// - `verifyStateRoot`, `verifyProposer`, `verifySignatures`: bool
/// - `dontTransferCache`: bool (negated to set `transfer_cache`)
/// - `executionPayloadStatus`: "valid" | "invalid" | "preMerge"
/// - `executionPayloadStatus`: "valid" | "invalid"
/// - `dataAvailabilityStatus`: "Available" | "PreData" | "OutOfRange"
///
/// Throws `error.InvalidExecutionPayloadStatus` / `error.InvalidDataAvailabilityStatus`
Expand Down Expand Up @@ -47,8 +47,6 @@ pub fn parseOptions(options: ?js.Value) !st.TransitionOpts {
.valid
else if (std.mem.eql(u8, status_str, "invalid"))
.invalid
else if (std.mem.eql(u8, status_str, "preMerge"))
.pre_merge
else
return error.InvalidExecutionPayloadStatus;
}
Expand Down
2 changes: 0 additions & 2 deletions bindings/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,6 @@ export declare class BeaconStateView {

isExecutionStateType: boolean;
isMergeTransitionComplete: boolean;
/** True iff state is pre-merge AND the given block carries a non-default execution payload. Bellatrix-only. */
isMergeTransitionBlock(signedBlockBytes: Uint8Array): boolean;
/**
* Check whether execution is enabled for the given block at this state.
*
Expand Down
7 changes: 2 additions & 5 deletions src/state_transition/block/process_blob_kzg_commitments.zig
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
const BlockExternalData = @import("../state_transition.zig").BlockExternalData;

pub fn processBlobKzgCommitments(external_data: BlockExternalData) !void {
switch (external_data.execution_payload_status) {
.pre_merge => return error.ExecutionPayloadStatusPreMerge,
.invalid => return error.InvalidExecutionPayload,
// ok
else => {},
if (external_data.execution_payload_status == .invalid) {
return error.InvalidExecutionPayload;
Comment on lines +4 to +5

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The new implementation uses an if statement that only handles the negative case (.invalid). According to the repository style guide (Lines 134-138), it is preferred to handle or assert both positive and negative spaces. Additionally, this function lacks the required minimum of two assertions per function (Line 54). Consider using a switch statement to explicitly handle all enum variants and adding assertions for the function arguments to improve safety and clarity.

References
  1. Assert the positive space that you do expect AND the negative space that you do not expect. (link)
  2. The assertion density of the code must average a minimum of two assertions per function. (link)

}
}

Expand Down
4 changes: 1 addition & 3 deletions src/state_transition/block/process_execution_payload.zig
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ pub fn processExecutionPayload(
// the state transition sync
//
// Equivalent to `assert executionEngine.notifyNewPayload(payload)
if (external_data.execution_payload_status == .pre_merge) {
return error.ExecutionPayloadStatusPreMerge;
} else if (external_data.execution_payload_status == .invalid) {
if (external_data.execution_payload_status == .invalid) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The processExecutionPayload function (lines 16-94) violates the repository style guide in two ways:

  1. Function Length: At 79 lines, it exceeds the hard limit of 70 lines per function (Line 108).
  2. Assertion Density: It does not meet the requirement of an average of two assertions per function (Line 54).

While the removal of the .pre_merge check is correct, this function should be refactored into smaller helpers with appropriate assertions for function arguments and invariants to adhere to the project's safety and maintainability standards.

References
  1. Hard limit of 70 lines per function. (link)
  2. Minimum of two assertions per function. (link)

return error.InvalidExecutionPayload;
}

Expand Down
1 change: 0 additions & 1 deletion src/state_transition/root.zig
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ pub const AnchorCheckpoint = @import("./AnchorCheckpoint.zig");
pub const deinitStateTransition = @import("./state_transition.zig").deinitStateTransition;
pub const isExecutionEnabled = @import("./utils/execution.zig").isExecutionEnabled;
pub const isMergeTransitionComplete = @import("./utils/execution.zig").isMergeTransitionComplete;
pub const isMergeTransitionBlock = @import("./utils/execution.zig").isMergeTransitionBlock;
pub const getRandaoMix = @import("./utils/seed.zig").getRandaoMix;
pub const getEffectiveBalanceIncrementsZeroInactive = @import("./utils/balance.zig").getEffectiveBalanceIncrementsZeroInactive;

Expand Down
1 change: 0 additions & 1 deletion src/state_transition/state_transition.zig
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const upgradeStateToElectra = @import("slot/upgrade_state_to_electra.zig").upgra
const upgradeStateToFulu = @import("slot/upgrade_state_to_fulu.zig").upgradeStateToFulu;

pub const ExecutionPayloadStatus = enum(u8) {
pre_merge,
invalid,
valid,
};
Expand Down
26 changes: 0 additions & 26 deletions src/state_transition/utils/execution.zig
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,6 @@ pub fn isExecutionEnabled(comptime fork: ForkSeq, state: *BeaconState(fork), com
}
}

pub fn isMergeTransitionBlock(
comptime fork: ForkSeq,
state: *BeaconState(fork),
comptime block_type: BlockType,
body: *const BeaconBlockBody(block_type, fork),
) bool {
if (comptime fork != .bellatrix) {
return false;
}

if (isMergeTransitionComplete(fork, state)) {
return false;
}

return switch (block_type) {
.full => !ForkTypes(fork).ExecutionPayload.equals(
&body.executionPayload().inner,
&ForkTypes(fork).ExecutionPayload.default_value,
),
.blinded => !ForkTypes(fork).ExecutionPayloadHeader.equals(
&body.executionPayloadHeader().inner,
&ForkTypes(fork).ExecutionPayloadHeader.default_value,
),
};
}

pub fn isMergeTransitionComplete(comptime fork: ForkSeq, state: *BeaconState(fork)) bool {
if (comptime fork.lt(.bellatrix)) {
return false;
Expand Down
Loading