Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4047ab4
add constants and configs
guha-rahul Mar 21, 2026
cd7986d
sdd ssz types
guha-rahul Mar 22, 2026
bbf5e83
add fork upgrade, utils, and shared helpers
guha-rahul Mar 23, 2026
542f373
fix gloas wiring
guha-rahul Mar 24, 2026
7a570c1
add PTC computaton and indexed payload attestation
guha-rahul Mar 28, 2026
3b9eb46
add process_builder_pending_payments
guha-rahul Mar 28, 2026
d48edb9
add exeution_payload_bid and validate builder bids
guha-rahul Mar 28, 2026
d1e7623
add builder withdrawal support
guha-rahul Mar 28, 2026
92fe8f2
fix withdrawals and ExecutionPayloadBid for 7732
guha-rahul Mar 28, 2026
5145647
add payload attestation processing to process operations
guha-rahul Mar 28, 2026
28dd2df
epbs attestation changes
guha-rahul Mar 28, 2026
641b589
add builder voluntary exit support
guha-rahul Mar 28, 2026
2a9a460
clear builder pending payemnt on slashing
guha-rahul Mar 28, 2026
dd08a13
add gloas deposit routing in processDepositRequest
guha-rahul Mar 28, 2026
34e8ee4
add processExecutionPayloadEnvelope
guha-rahul Mar 29, 2026
2bb3d24
add gloas fork support to spec test runners
guha-rahul Mar 29, 2026
e9173be
Merge remote-tracking branch 'origin/main' into G-fork
guha-rahul Mar 30, 2026
34457e6
fix merge
guha-rahul Mar 30, 2026
8daad8a
skip gloas in block benchmark
guha-rahul Mar 30, 2026
c3bc1f0
fix gloas comment
guha-rahul Mar 30, 2026
14f7e93
fix test infra for gloas
guha-rahul Apr 1, 2026
7ba705d
fix: process_withdrawals spec
guha-rahul Apr 2, 2026
2fff48b
fix: voluntary exit builder support for gloas
guha-rahul Apr 2, 2026
4d91014
fix:processExecutionPayloadEnvelope
guha-rahul Apr 2, 2026
85667af
fix: process_deposit_request builder routing
guha-rahul Apr 2, 2026
5fefa52
feat: add computePtc and balance-weighted helpers
guha-rahul Apr 2, 2026
33a1852
feat: add PtcWindow to gloas state and read PTC from state.ptc_window
guha-rahul Apr 2, 2026
144da0b
fix: gloas attestation index validation and proposer slashing epoch calc
guha-rahul Apr 2, 2026
2a3962f
Merge branch 'ChainSafe:main' into G-fork
guha-rahul Apr 2, 2026
1f717e8
zig fmt and test:config
guha-rahul Apr 2, 2026
9da8da0
zbuild sync
guha-rahul Apr 2, 2026
9e68689
update zbuild and zbuild sync
guha-rahul Apr 2, 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
2 changes: 2 additions & 0 deletions bench/state_transition/process_block.zig
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ pub fn main() !void {
defer allocator.free(block_bytes);

inline for (comptime std.enums.values(ForkSeq)) |fork| {
// TODO: add gloas benchmark support
if (comptime fork == .gloas) continue;
if (detected_fork == fork) return runBenchmark(fork, allocator, &pool, stdout, state_bytes, block_bytes, chain_config);
}
return error.NoBenchmarkRan;
Expand Down
2 changes: 2 additions & 0 deletions bindings/napi/BeaconStateView.zig
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ pub fn BeaconStateView_getVoluntaryExitValidity(env: napi.Env, cb: napi.Callback
const result = switch (cached_state.state.forkSeq()) {
inline else => |f| st.getVoluntaryExitValidity(
f,
allocator,
cached_state.config,
cached_state.epoch_cache,
cached_state.state.castToFork(f),
Expand Down Expand Up @@ -707,6 +708,7 @@ pub fn BeaconStateView_isValidVoluntaryExit(env: napi.Env, cb: napi.CallbackInfo
const result = switch (cached_state.state.forkSeq()) {
inline else => |f| st.isValidVoluntaryExit(
f,
allocator,
cached_state.config,
cached_state.epoch_cache,
cached_state.state.castToFork(f),
Expand Down
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn build(b: *std.Build) void {
const options_spec_test_options = b.addOptions();
const option_spec_test_url = b.option([]const u8, "spec_test_url", "") orelse "https://github.com/ethereum/consensus-specs";
options_spec_test_options.addOption([]const u8, "spec_test_url", option_spec_test_url);
const option_spec_test_version = b.option([]const u8, "spec_test_version", "") orelse "v1.6.0-beta.2";
const option_spec_test_version = b.option([]const u8, "spec_test_version", "") orelse "v1.7.0-alpha.4";
options_spec_test_options.addOption([]const u8, "spec_test_version", option_spec_test_version);
const option_spec_test_out_dir = b.option([]const u8, "spec_test_out_dir", "") orelse "test/spec/spec_tests";
options_spec_test_options.addOption([]const u8, "spec_test_out_dir", option_spec_test_out_dir);
Expand Down
12 changes: 11 additions & 1 deletion src/config/BeaconConfig.zig
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ pub fn init(chain_config: ChainConfig, genesis_validator_root: Root) BeaconConfi
.prev_fork_seq = ForkSeq.electra,
};

const gloas = ForkInfo{
.fork_seq = ForkSeq.gloas,
.epoch = chain_config.GLOAS_FORK_EPOCH,
.version = chain_config.GLOAS_FORK_VERSION,
.prev_version = chain_config.FULU_FORK_VERSION,
.prev_fork_seq = ForkSeq.fulu,
};

const forks_ascending_epoch_order = [ForkSeq.count]ForkInfo{
phase0,
altair,
Expand All @@ -140,8 +148,10 @@ pub fn init(chain_config: ChainConfig, genesis_validator_root: Root) BeaconConfi
deneb,
electra,
fulu,
gloas,
};
const forks_descending_epoch_order = [ForkSeq.count]ForkInfo{
gloas,
fulu,
electra,
deneb,
Expand Down Expand Up @@ -213,7 +223,7 @@ pub fn getMaxBlobsPerBlock(self: *const BeaconConfig, epoch: Epoch) u64 {
return switch (fork) {
.deneb => self.chain.MAX_BLOBS_PER_BLOCK,
.electra => self.chain.MAX_BLOBS_PER_BLOCK_ELECTRA,
.fulu => {
.fulu, .gloas => {
for (0..self.chain.BLOB_SCHEDULE.len) |i| {
const schedule = self.chain.BLOB_SCHEDULE[self.chain.BLOB_SCHEDULE.len - i - 1];
if (epoch >= schedule.EPOCH) return schedule.MAX_BLOBS_PER_BLOCK;
Expand Down
6 changes: 5 additions & 1 deletion src/config/ChainConfig.zig
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ DENEB_FORK_EPOCH: u64,
// ELECTRA
ELECTRA_FORK_VERSION: [4]u8,
ELECTRA_FORK_EPOCH: u64,
// FULU (assuming it's a future fork, standard pattern)
// FULU
FULU_FORK_VERSION: [4]u8,
FULU_FORK_EPOCH: u64,
// GLOAS
GLOAS_FORK_VERSION: [4]u8,
GLOAS_FORK_EPOCH: u64,

// Time parameters
SECONDS_PER_SLOT: u64,
SECONDS_PER_ETH1_BLOCK: u64,
MIN_VALIDATOR_WITHDRAWABILITY_DELAY: u64,
MIN_BUILDER_WITHDRAWABILITY_DELAY: u64,
SHARD_COMMITTEE_PERIOD: u64,
ETH1_FOLLOW_DISTANCE: u64,

Expand Down
3 changes: 3 additions & 0 deletions src/config/fork_seq.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub const ForkSeq = enum(u8) {
deneb = 4,
electra = 5,
fulu = 6,
gloas = 7,

/// Total number of fork variants.
pub const count: u8 = @intCast(@typeInfo(ForkSeq).@"enum".fields.len);
Expand Down Expand Up @@ -66,6 +67,7 @@ test "fork - ForkSeq.name" {
try std.testing.expectEqualSlices(u8, "deneb", ForkSeq.deneb.name());
try std.testing.expectEqualSlices(u8, "electra", ForkSeq.electra.name());
try std.testing.expectEqualSlices(u8, "fulu", ForkSeq.fulu.name());
try std.testing.expectEqualSlices(u8, "gloas", ForkSeq.gloas.name());
}

test "fork - ForkSeq.fromName" {
Expand All @@ -76,4 +78,5 @@ test "fork - ForkSeq.fromName" {
try std.testing.expectEqual(ForkSeq.deneb, ForkSeq.fromName("deneb"));
try std.testing.expectEqual(ForkSeq.electra, ForkSeq.fromName("electra"));
try std.testing.expectEqual(ForkSeq.fulu, ForkSeq.fromName("fulu"));
try std.testing.expectEqual(ForkSeq.gloas, ForkSeq.fromName("gloas"));
}
2 changes: 2 additions & 0 deletions src/config/networks/chiado.zig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pub const chain_config = gnosis.chain_config.merge(.{
.ELECTRA_FORK_EPOCH = 948224,
.FULU_FORK_VERSION = b(4, "0x0600006f"),
.FULU_FORK_EPOCH = std.math.maxInt(u64),
.GLOAS_FORK_VERSION = b(4, "0x0700006f"),
.GLOAS_FORK_EPOCH = std.math.maxInt(u64),

// Deposit contract
.DEPOSIT_CHAIN_ID = 10200,
Expand Down
3 changes: 3 additions & 0 deletions src/config/networks/gnosis.zig
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ pub const chain_config = ChainConfig{
.ELECTRA_FORK_EPOCH = 1337856,
.FULU_FORK_VERSION = b(4, "0x06000064"),
.FULU_FORK_EPOCH = std.math.maxInt(u64),
.GLOAS_FORK_VERSION = b(4, "0x07000064"),
.GLOAS_FORK_EPOCH = std.math.maxInt(u64),

// Time parameters
.SECONDS_PER_SLOT = 5,
.SECONDS_PER_ETH1_BLOCK = 6,
.MIN_VALIDATOR_WITHDRAWABILITY_DELAY = 256,
.MIN_BUILDER_WITHDRAWABILITY_DELAY = 64,
.SHARD_COMMITTEE_PERIOD = 256,
.ETH1_FOLLOW_DISTANCE = 1024,

Expand Down
3 changes: 3 additions & 0 deletions src/config/networks/hoodi.zig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const std = @import("std");
const ChainConfig = @import("../ChainConfig.zig");
const BeaconConfig = @import("../BeaconConfig.zig");
const b = @import("hex").hexToBytesComptime;
Expand Down Expand Up @@ -29,6 +30,8 @@ pub const chain_config = mainnet.chain_config.merge(.{
.ELECTRA_FORK_EPOCH = 2048,
.FULU_FORK_VERSION = b(4, "0x70000910"),
.FULU_FORK_EPOCH = 50688,
.GLOAS_FORK_VERSION = b(4, "0x80000910"),
.GLOAS_FORK_EPOCH = std.math.maxInt(u64),

// Time parameters
.SECONDS_PER_ETH1_BLOCK = 12,
Expand Down
3 changes: 3 additions & 0 deletions src/config/networks/mainnet.zig
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ pub const chain_config = ChainConfig{
.ELECTRA_FORK_EPOCH = 364032,
.FULU_FORK_VERSION = b(4, "0x06000000"),
.FULU_FORK_EPOCH = 411392,
.GLOAS_FORK_VERSION = b(4, "0x07000000"),
.GLOAS_FORK_EPOCH = std.math.maxInt(u64),

// Time parameters
.SECONDS_PER_SLOT = 12,
.SECONDS_PER_ETH1_BLOCK = 14,
.MIN_VALIDATOR_WITHDRAWABILITY_DELAY = 256,
.MIN_BUILDER_WITHDRAWABILITY_DELAY = 64,
.SHARD_COMMITTEE_PERIOD = 256,
.ETH1_FOLLOW_DISTANCE = 2048,

Expand Down
3 changes: 3 additions & 0 deletions src/config/networks/minimal.zig
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ pub const chain_config = ChainConfig{
.ELECTRA_FORK_EPOCH = std.math.maxInt(u64),
.FULU_FORK_VERSION = b(4, "0x06000001"),
.FULU_FORK_EPOCH = std.math.maxInt(u64),
.GLOAS_FORK_VERSION = b(4, "0x07000001"),
.GLOAS_FORK_EPOCH = std.math.maxInt(u64),

// Time parameters
.SECONDS_PER_SLOT = 6,
.SECONDS_PER_ETH1_BLOCK = 14,
.MIN_VALIDATOR_WITHDRAWABILITY_DELAY = 256,
.MIN_BUILDER_WITHDRAWABILITY_DELAY = 2,
.SHARD_COMMITTEE_PERIOD = 64,
.ETH1_FOLLOW_DISTANCE = 16,

Expand Down
3 changes: 3 additions & 0 deletions src/config/networks/sepolia.zig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const std = @import("std");
const ChainConfig = @import("../ChainConfig.zig");
const BeaconConfig = @import("../BeaconConfig.zig");
const b = @import("hex").hexToBytesComptime;
Expand Down Expand Up @@ -30,6 +31,8 @@ pub const chain_config = mainnet.chain_config.merge(.{
.ELECTRA_FORK_EPOCH = 222464,
.FULU_FORK_VERSION = b(4, "0x90000075"),
.FULU_FORK_EPOCH = 272640,
.GLOAS_FORK_VERSION = b(4, "0x90000076"),
.GLOAS_FORK_EPOCH = std.math.maxInt(u64),

// Deposit contract
.DEPOSIT_CHAIN_ID = 11155111,
Expand Down
Loading
Loading