implement start lean node using genesis config files for devnet-0#174
implement start lean node using genesis config files for devnet-0#174g11tech merged 16 commits intoblockblaz:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new "lean_node" command to the CLI that enables lightweight Ethereum node startup using YAML configuration files. The implementation adds support for parsing genesis configuration, bootnode ENRs, and validator assignments from YAML files, while also enabling QUIC transport in the libp2p networking layer.
- Adds a new
lean_nodeCLI command with YAML-based configuration management - Enables QUIC transport support in the Rust libp2p bridge
- Implements YAML parsing utilities and test fixtures for devnet configuration
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| rust/src/libp2p_bridge.rs | Enables QUIC transport and adds peer ID stripping for listen addresses |
| pkgs/configs/src/lib.zig | Adds YAML parsing utility function for configuration files |
| pkgs/cli/src/main.zig | Implements new lean_node command with YAML configuration parsing |
| pkgs/cli/src/fixtures/*.yaml | Test fixture files for configuration, nodes, and validators |
| build.zig.zon | Adds zig-yaml dependency |
| build.zig | Integrates YAML module into build configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
pkgs/cli/src/main.zig
Outdated
| const loop = try allocator.create(xev.Loop); | ||
| loop.* = try xev.Loop.init(.{}); | ||
|
|
||
| const self_node_index = validator_indices[0]; |
There was a problem hiding this comment.
Potential array bounds error if validator_indices is empty. The code should validate that validator_indices has at least one element before accessing index 0.
Signed-off-by: Chen Kai <281165273grape@gmail.com>
Signed-off-by: Chen Kai <281165273grape@gmail.com>
Signed-off-by: Chen Kai <281165273grape@gmail.com>
Signed-off-by: Chen Kai <281165273grape@gmail.com>
Signed-off-by: Chen Kai <281165273grape@gmail.com>
Signed-off-by: Chen Kai <281165273grape@gmail.com>
Signed-off-by: Chen Kai <281165273grape@gmail.com>
Signed-off-by: Chen Kai <281165273grape@gmail.com>
Signed-off-by: Chen Kai <281165273grape@gmail.com>
Signed-off-by: Chen Kai <281165273grape@gmail.com>
Signed-off-by: Chen Kai <281165273grape@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…#173) * Replace std.debug.print with logger in networks * Address review comment
* fix: fix build error on x86 intel macOS Signed-off-by: Chen Kai <281165273grape@gmail.com> * fix: remove unused change Signed-off-by: Chen Kai <281165273grape@gmail.com> --------- Signed-off-by: Chen Kai <281165273grape@gmail.com>
Signed-off-by: Chen Kai <281165273grape@gmail.com>
|
can you post a snapshot of doing a local run and a followup PR for CI test run i). running genesis tool to produce fresh genesis files for 2 nodes, ii)run these two nodes to finalization i.e. also add a way to specify & exit node when finalization happens |
Is it same with #164 ? |
yes for this PR can you post me a screenshot of the node run? |
node1 log: kaichen@Kais-MacBook-Pro zeam % ./zig-out/bin/zeam node --custom_genesis ~/genesis --node_id 1
opts =simargs.StructArguments(main.ZeamArgs,"unknown"[0..7],"Zeam - Zig implementation of Beam Chain, a ZK-based Ethereum Consensus Protocol"[0..79]){ .program = { 46, 47, 122, 105, 103, 45, 111, 117, 116, 47, 98, 105, 110, 47, 122, 101, 97, 109 }, .args = main.ZeamArgs{ .genesis = 1234, .log_filename = { 99, 111, 110, 115, 101, 110, 115, 117, 115 }, .log_filepath = { 46, 47, 108, 111, 103 }, .log_file_active_level = log.Level.debug, .console_log_level = log.Level.info, .num_validators = 3, .help = false, .version = false, .__commands__ = main.ZeamArgs__union_19329{ .node = main.ZeamArgs__union_19329__struct_19334{ ... } } }, .positional_args = { }, .raw_args = { { 46, 47, 122, 105, 103, 45, 111, 117, 116, 47, 98, 105, 110, 47, 122, 101, 97, 109 }, { 110, 111, 100, 101 }, { 45, 45, 99, 117, 115, 116, 111, 109, 95, 103, 101, 110, 101, 115, 105, 115 }, { 47, 85, 115, 101, 114, 115, 47, 107, 97, 105, 99, 104, 101, 110, 47, 103, 101, 110, 101, 115, 105, 115 }, { 45, 45, 110, 111, 100, 101, 95, 105, 100 }, { 49 } }, .allocator = mem.Allocator{ .ptr = anyopaque@7ff7b14e3f60, .vtable = mem.Allocator.VTable{ .alloc = fn (*anyopaque, usize, mem.Alignment, usize) ?[*]u8@10f2e8a60, .resize = fn (*anyopaque, []u8, mem.Alignment, usize, usize) bool@10f2e8d40, .remap = fn (*anyopaque, []u8, mem.Alignment, usize, usize) ?[*]u8@10f2e8e20, .free = fn (*anyopaque, []u8, mem.Alignment, usize) void@10f2e8f00 } } } genesis=1234 num_validators=3
ERROR: Failed to open directory './log': error.FileNotFound
Lean node 1 listened on 8081
build the transport
starting listener
going for loop match
dialing libp2p peer address: /ip4/127.0.0.1/udp/8080/quic-v1
Listening on /ip4/127.0.0.1/udp/8081/quic-v1
Listening on /ip4/192.168.3.104/udp/8081/quic-v1
Listening on /ip4/26.26.26.1/udp/8081/quic-v1
ConnectionEstablished { peer_id: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection_id: ConnectionId(1), endpoint: Dialer { address: /ip4/127.0.0.1/udp/8080/quic-v1, role_override: Dialer, port_use: Reuse }, num_established: 1, concurrent_dial_errors: Some([]), established_in: 2.91728ms }
Behaviour(BehaviourEvent: Received { connection_id: ConnectionId(1), peer_id: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), info: Info { public_key: PublicKey { publickey: Secp256k1(PublicKey(compressed): 212a318d42867ec3692a8b9eebcf1916e0ea13737f54e1d325c8c5794d6f7) }, protocol_version: "/ipfs/0.1.0", agent_version: "rust-libp2p/0.45.0", listen_addrs: [/ip4/127.0.0.1/udp/8080/quic-v1, /ip4/26.26.26.1/udp/8080/quic-v1, /ip4/192.168.3.104/udp/8080/quic-v1], protocols: ["/meshsub/1.1.0", "/ipfs/id/push/1.0.0", "/ipfs/ping/1.0.0", "/meshsub/1.0.0", "/ipfs/id/1.0.0"], observed_addr: /ip4/127.0.0.1/udp/8081/quic-v1 } })
NewExternalAddrOfPeer { peer_id: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), address: /ip4/127.0.0.1/udp/8080/quic-v1 }
NewExternalAddrOfPeer { peer_id: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), address: /ip4/26.26.26.1/udp/8080/quic-v1 }
NewExternalAddrOfPeer { peer_id: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), address: /ip4/192.168.3.104/udp/8080/quic-v1 }
NewExternalAddrCandidate { address: /ip4/127.0.0.1/udp/8081/quic-v1 }
Behaviour(BehaviourEvent: Sent { connection_id: ConnectionId(1), peer_id: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc") })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(391.84µs) })
Behaviour(BehaviourEvent: Subscribed { peer_id: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), topic: TopicHash { hash: "vote" } })
Behaviour(BehaviourEvent: Subscribed { peer_id: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), topic: TopicHash { hash: "block" } })
IncomingConnection { connection_id: ConnectionId(2), local_addr: /ip4/0.0.0.0/udp/8081/quic-v1, send_back_addr: /ip4/127.0.0.1/udp/8080/quic-v1 }
ConnectionEstablished { peer_id: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection_id: ConnectionId(2), endpoint: Listener { local_addr: /ip4/0.0.0.0/udp/8081/quic-v1, send_back_addr: /ip4/127.0.0.1/udp/8080/quic-v1 }, num_established: 2, concurrent_dial_errors: None, established_in: 2.240447ms }
Behaviour(BehaviourEvent: Sent { connection_id: ConnectionId(2), peer_id: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc") })
Behaviour(BehaviourEvent: Received { connection_id: ConnectionId(2), peer_id: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), info: Info { public_key: PublicKey { publickey: Secp256k1(PublicKey(compressed): 212a318d42867ec3692a8b9eebcf1916e0ea13737f54e1d325c8c5794d6f7) }, protocol_version: "/ipfs/0.1.0", agent_version: "rust-libp2p/0.45.0", listen_addrs: [/ip4/192.168.3.104/udp/8080/quic-v1, /ip4/26.26.26.1/udp/8080/quic-v1, /ip4/127.0.0.1/udp/8080/quic-v1], protocols: ["/ipfs/ping/1.0.0", "/meshsub/1.0.0", "/ipfs/id/push/1.0.0", "/ipfs/id/1.0.0", "/meshsub/1.1.0"], observed_addr: /ip4/127.0.0.1/udp/8081/quic-v1 } })
NewExternalAddrCandidate { address: /ip4/127.0.0.1/udp/8081/quic-v1 }
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(228.21µs) })
Sep-15 04:08:59.575 [info] (zeam): chain received on slot cb at slot=13456033 head={ 242, 101, 9, 66, 239, 173, 123, 87, 230, 210, 216, 36, 74, 171, 90, 20, 137, 111, 0, 129, 42, 181, 152, 173, 149, 198, 42, 23, 208, 158, 193, 136 } headslot=0
Sep-15 04:08:59.575 [ERROR] (zeam): : Failed to write to log file
Sep-15 04:08:59.575 [info] (zeam): constructing vote message for slot=13456033
Sep-15 04:08:59.575 [ERROR] (zeam): : Failed to write to log file
Sep-15 04:08:59.575 [info] (zeam): validator constructed vote slot=13456033 vote=interface.GossipMessage{ .vote = lib.SignedVote{ .validator_id = 1, .message = lib.Mini3SFVote{ .slot = 13456033, .head = lib.Mini3SFCheckpoint{ ... }, .target = lib.Mini3SFCheckpoint{ ... }, .source = lib.Mini3SFCheckpoint{ ... } }, .signature = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } }
Sep-15 04:08:59.575 [ERROR] (zeam): : Failed to write to log file
rustbridge-0:: publishing message s=[1, 0, 0, 0, 0, 0, 0, 0, 161, 82, 205, 0, 0, 0, 0, 0, 242, 101, 9, 66, 239, 173, 123, 87, 230, 210, 216, 36, 74, 171, 90, 20, 137, 111, 0, 129, 42, 181, 152, 173, 149, 198, 42, 23, 208, 158, 193, 136, 0, 0, 0, 0, 0, 0, 0, 0, 242, 101, 9, 66, 239, 173, 123, 87, 230, 210, 216, 36, 74, 171, 90, 20, 137, 111, 0, 129, 42, 181, 152, 173, 149, 198, 42, 23, 208, 158, 193, 136, 0, 0, 0, 0, 0, 0, 0, 0, 242, 101, 9, 66, 239, 173, 123, 87, 230, 210, 216, 36, 74, 171, 90, 20, 137, 111, 0, 129, 42, 181, 152, 173, 149, 198, 42, 23, 208, 158, 193, 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Sep-15 04:09:00.000 [info] (zeam): constructing block message slot=13456035 proposer=1
Sep-15 04:09:00.000 [ERROR] (zeam): : Failed to write to log file
rustbridge0:: zig callback completed
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(311.612µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(295.577µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(317.722µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(384.115µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(289.954µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(338.173µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(283.393µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(363.185µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(298.683µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(351.233µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(297.378µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(365.06µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(288.401µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(362.689µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(325.988µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(337.139µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(314.734µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(358.421µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(320.491µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(248.825µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(386.924µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(2), result: Ok(316.636µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAkvgRZR1mMhApM1mb1m4gK9KCniM8EdSCezqKW9W7yuehc"), connection: ConnectionId(1), result: Ok(271.305µs) })
thread 8423602 panic: index out of bounds: index 1023, len 256
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:642:48: 0x10f282298 in merkleize__anon_20958 (zeam)
} else digest.update(hashes_of_zero[size / 2 - 1][0..]);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x10f28209f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x10f2820e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x10f28209f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x10f2820e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x10f28209f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x10f2820e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x10f28209f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x10f2820e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x10f2820e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x10f28209f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x10f28209f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x10f2820e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x10f2820e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:798:42: 0x10f28460f in hashTreeRoot__anon_21335 (zeam)
try merkleize(sha256, chunks.items, null, &tmp);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:811:33: 0x10f284dc4 in hashTreeRoot__anon_21175 (zeam)
try hashTreeRoot(f.type, @field(value, f.name), &tmp, allctr);
^
/Users/kaichen/Documents/projects/zeam/pkgs/state-transition/src/transition.zig:310:25: 0x10f2a5d66 in apply_raw_block (zeam)
try ssz.hashTreeRoot(types.BeamState, state.*, &state_root, allocator);
^
/Users/kaichen/Documents/projects/zeam/pkgs/node/src/chain.zig:129:32: 0x10f30958c in produceBlock (zeam)
try stf.apply_raw_block(self.allocator, &post_state, &block, self.logger);
^
/Users/kaichen/Documents/projects/zeam/pkgs/node/src/validator.zig:63:54: 0x10f30cdc6 in maybeDoProposal (zeam)
const block = try self.chain.produceBlock(.{ .slot = slot, .proposer_index = slot_proposer_id });
^
/Users/kaichen/Documents/projects/zeam/pkgs/node/src/validator.zig:47:45: 0x10f2cbe5a in onInterval (zeam)
0 => return self.maybeDoProposal(slot),
^
/Users/kaichen/Documents/projects/zeam/pkgs/node/src/utils.zig:41:33: 0x10f32e5b7 in callback (zeam)
return self.onIntervalCb(self.ptr, self.interval);
^
/Users/kaichen/.cache/zig/p/libxev-0.0.0-86vtc-zkEgB7uv1i0Sa6ytJETZQi_lHJrImu9mLb9moi/src/backend/kqueue.zig:401:42: 0x10f281003 in run (zeam)
const action = c.callback(c.userdata, self, c, .{ .timer = .expiration });
^
/Users/kaichen/Documents/projects/zeam/pkgs/cli/src/node.zig:179:18: 0x10f2e49b6 in main (zeam)
try clock.run();
^
/Users/kaichen/.local/share/zigup/0.14.1/files/lib/std/start.zig:660:37: 0x10f2e88d1 in main (zeam)
const result = root.main() catch |err| {
^
???:?:?: 0x7ff81987552f in ??? (???)
Unwind information for `???:0x7ff81987552f` was not available, trace may be incomplete
???:?:?: 0x0 in ??? (???)node0 log: kaichen@Kais-MacBook-Pro zeam % ./zig-out/bin/zeam node --custom_genesis ~/genesis --node_id 0
opts =simargs.StructArguments(main.ZeamArgs,"unknown"[0..7],"Zeam - Zig implementation of Beam Chain, a ZK-based Ethereum Consensus Protocol"[0..79]){ .program = { 46, 47, 122, 105, 103, 45, 111, 117, 116, 47, 98, 105, 110, 47, 122, 101, 97, 109 }, .args = main.ZeamArgs{ .genesis = 1234, .log_filename = { 99, 111, 110, 115, 101, 110, 115, 117, 115 }, .log_filepath = { 46, 47, 108, 111, 103 }, .log_file_active_level = log.Level.debug, .console_log_level = log.Level.info, .num_validators = 3, .help = false, .version = false, .__commands__ = main.ZeamArgs__union_19329{ .node = main.ZeamArgs__union_19329__struct_19334{ ... } } }, .positional_args = { }, .raw_args = { { 46, 47, 122, 105, 103, 45, 111, 117, 116, 47, 98, 105, 110, 47, 122, 101, 97, 109 }, { 110, 111, 100, 101 }, { 45, 45, 99, 117, 115, 116, 111, 109, 95, 103, 101, 110, 101, 115, 105, 115 }, { 47, 85, 115, 101, 114, 115, 47, 107, 97, 105, 99, 104, 101, 110, 47, 103, 101, 110, 101, 115, 105, 115 }, { 45, 45, 110, 111, 100, 101, 95, 105, 100 }, { 48 } }, .allocator = mem.Allocator{ .ptr = anyopaque@7ff7b70bff60, .vtable = mem.Allocator.VTable{ .alloc = fn (*anyopaque, usize, mem.Alignment, usize) ?[*]u8@10970ca60, .resize = fn (*anyopaque, []u8, mem.Alignment, usize, usize) bool@10970cd40, .remap = fn (*anyopaque, []u8, mem.Alignment, usize, usize) ?[*]u8@10970ce20, .free = fn (*anyopaque, []u8, mem.Alignment, usize) void@10970cf00 } } } genesis=1234 num_validators=3
ERROR: Failed to open directory './log': error.FileNotFound
Lean node 0 listened on 8080
build the transport
starting listener
going for loop match
dialing libp2p peer address: /ip4/127.0.0.1/udp/8081/quic-v1
Listening on /ip4/127.0.0.1/udp/8080/quic-v1
Listening on /ip4/192.168.3.104/udp/8080/quic-v1
Listening on /ip4/26.26.26.1/udp/8080/quic-v1
IncomingConnection { connection_id: ConnectionId(2), local_addr: /ip4/0.0.0.0/udp/8080/quic-v1, send_back_addr: /ip4/127.0.0.1/udp/8081/quic-v1 }
ConnectionEstablished { peer_id: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection_id: ConnectionId(2), endpoint: Listener { local_addr: /ip4/0.0.0.0/udp/8080/quic-v1, send_back_addr: /ip4/127.0.0.1/udp/8081/quic-v1 }, num_established: 1, concurrent_dial_errors: None, established_in: 2.740121ms }
Behaviour(BehaviourEvent: Sent { connection_id: ConnectionId(2), peer_id: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac") })
Behaviour(BehaviourEvent: Subscribed { peer_id: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), topic: TopicHash { hash: "vote" } })
Behaviour(BehaviourEvent: Subscribed { peer_id: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), topic: TopicHash { hash: "block" } })
Behaviour(BehaviourEvent: Received { connection_id: ConnectionId(2), peer_id: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), info: Info { public_key: PublicKey { publickey: Secp256k1(PublicKey(compressed): 28b1e34eb97dce8be62fc57212b67516575f0c23438a0218c88c1cc245dddcc9) }, protocol_version: "/ipfs/0.1.0", agent_version: "rust-libp2p/0.45.0", listen_addrs: [/ip4/127.0.0.1/udp/8081/quic-v1, /ip4/192.168.3.104/udp/8081/quic-v1, /ip4/26.26.26.1/udp/8081/quic-v1], protocols: ["/meshsub/1.0.0", "/ipfs/ping/1.0.0", "/meshsub/1.1.0", "/ipfs/id/push/1.0.0", "/ipfs/id/1.0.0"], observed_addr: /ip4/127.0.0.1/udp/8080/quic-v1 } })
NewExternalAddrOfPeer { peer_id: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), address: /ip4/127.0.0.1/udp/8081/quic-v1 }
NewExternalAddrOfPeer { peer_id: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), address: /ip4/192.168.3.104/udp/8081/quic-v1 }
NewExternalAddrOfPeer { peer_id: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), address: /ip4/26.26.26.1/udp/8081/quic-v1 }
NewExternalAddrCandidate { address: /ip4/127.0.0.1/udp/8080/quic-v1 }
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(334.797µs) })
ConnectionEstablished { peer_id: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection_id: ConnectionId(1), endpoint: Dialer { address: /ip4/127.0.0.1/udp/8081/quic-v1, role_override: Dialer, port_use: Reuse }, num_established: 2, concurrent_dial_errors: Some([]), established_in: 3.002266745s }
Behaviour(BehaviourEvent: Received { connection_id: ConnectionId(1), peer_id: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), info: Info { public_key: PublicKey { publickey: Secp256k1(PublicKey(compressed): 28b1e34eb97dce8be62fc57212b67516575f0c23438a0218c88c1cc245dddcc9) }, protocol_version: "/ipfs/0.1.0", agent_version: "rust-libp2p/0.45.0", listen_addrs: [/ip4/26.26.26.1/udp/8081/quic-v1, /ip4/192.168.3.104/udp/8081/quic-v1, /ip4/127.0.0.1/udp/8081/quic-v1], protocols: ["/ipfs/id/1.0.0", "/ipfs/ping/1.0.0", "/meshsub/1.0.0", "/ipfs/id/push/1.0.0", "/meshsub/1.1.0"], observed_addr: /ip4/127.0.0.1/udp/8080/quic-v1 } })
NewExternalAddrCandidate { address: /ip4/127.0.0.1/udp/8080/quic-v1 }
Behaviour(BehaviourEvent: Sent { connection_id: ConnectionId(1), peer_id: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac") })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(404.395µs) })
rustbridge0:: zig callback completed
Sep-15 04:09:01.000 [info] (zeam): chain received on slot cb at slot=13456035 head={ 242, 101, 9, 66, 239, 173, 123, 87, 230, 210, 216, 36, 74, 171, 90, 20, 137, 111, 0, 129, 42, 181, 152, 173, 149, 198, 42, 23, 208, 158, 193, 136 } headslot=0
Sep-15 04:09:01.000 [ERROR] (zeam): : Failed to write to log file
Sep-15 04:09:01.000 [info] (zeam): constructing vote message for slot=13456035
Sep-15 04:09:01.000 [ERROR] (zeam): : Failed to write to log file
Sep-15 04:09:01.000 [info] (zeam): validator constructed vote slot=13456035 vote=interface.GossipMessage{ .vote = lib.SignedVote{ .validator_id = 0, .message = lib.Mini3SFVote{ .slot = 13456035, .head = lib.Mini3SFCheckpoint{ ... }, .target = lib.Mini3SFCheckpoint{ ... }, .source = lib.Mini3SFCheckpoint{ ... } }, .signature = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } }
Sep-15 04:09:01.000 [ERROR] (zeam): : Failed to write to log file
rustbridge-0:: publishing message s=[0, 0, 0, 0, 0, 0, 0, 0, 163, 82, 205, 0, 0, 0, 0, 0, 242, 101, 9, 66, 239, 173, 123, 87, 230, 210, 216, 36, 74, 171, 90, 20, 137, 111, 0, 129, 42, 181, 152, 173, 149, 198, 42, 23, 208, 158, 193, 136, 0, 0, 0, 0, 0, 0, 0, 0, 242, 101, 9, 66, 239, 173, 123, 87, 230, 210, 216, 36, 74, 171, 90, 20, 137, 111, 0, 129, 42, 181, 152, 173, 149, 198, 42, 23, 208, 158, 193, 136, 0, 0, 0, 0, 0, 0, 0, 0, 242, 101, 9, 66, 239, 173, 123, 87, 230, 210, 216, 36, 74, 171, 90, 20, 137, 111, 0, 129, 42, 181, 152, 173, 149, 198, 42, 23, 208, 158, 193, 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Sep-15 04:09:04.001 [info] (zeam): constructing block message slot=13456036 proposer=0
Sep-15 04:09:04.001 [ERROR] (zeam): : Failed to write to log file
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(279.632µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(314.065µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(308.431µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(285.722µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(365.847µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(300.892µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(346.004µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(338.413µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(360.672µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(270.715µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(370.936µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(300.112µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(364.036µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(313.85µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(356.511µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(326.103µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(213.632µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(294.795µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(247.732µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(304.089µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(312.125µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(1), result: Ok(321.651µs) })
Behaviour(BehaviourEvent: Event { peer: PeerId("16Uiu2HAm4njN7zwDKXmZQw9xwZPy1bjJNnpkQCTEKJrQA5h1A6Ac"), connection: ConnectionId(2), result: Ok(255.571µs) })
thread 8423546 panic: index out of bounds: index 1023, len 256
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:642:48: 0x1096a6298 in merkleize__anon_20958 (zeam)
} else digest.update(hashes_of_zero[size / 2 - 1][0..]);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x1096a609f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x1096a60e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x1096a609f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x1096a60e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x1096a609f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x1096a60e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x1096a609f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x1096a60e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x1096a60e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x1096a609f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:633:26: 0x1096a609f in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[0..split], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x1096a60e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:640:30: 0x1096a60e9 in merkleize__anon_20958 (zeam)
try merkleize(hasher, chunks[size / 2 ..], size / 2, &buf);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:798:42: 0x1096a860f in hashTreeRoot__anon_21335 (zeam)
try merkleize(sha256, chunks.items, null, &tmp);
^
/Users/kaichen/.cache/zig/p/ssz-0.0.4-Lfwd6_eVAQBDY0aibF_D0ys8YIp6QIzsMTna4w1026QY/src/lib.zig:811:33: 0x1096a8dc4 in hashTreeRoot__anon_21175 (zeam)
try hashTreeRoot(f.type, @field(value, f.name), &tmp, allctr);
^
/Users/kaichen/Documents/projects/zeam/pkgs/state-transition/src/transition.zig:310:25: 0x1096c9d66 in apply_raw_block (zeam)
try ssz.hashTreeRoot(types.BeamState, state.*, &state_root, allocator);
^
/Users/kaichen/Documents/projects/zeam/pkgs/node/src/chain.zig:129:32: 0x10972d58c in produceBlock (zeam)
try stf.apply_raw_block(self.allocator, &post_state, &block, self.logger);
^
/Users/kaichen/Documents/projects/zeam/pkgs/node/src/validator.zig:63:54: 0x109730dc6 in maybeDoProposal (zeam)
const block = try self.chain.produceBlock(.{ .slot = slot, .proposer_index = slot_proposer_id });
^
/Users/kaichen/Documents/projects/zeam/pkgs/node/src/validator.zig:47:45: 0x1096efe5a in onInterval (zeam)
0 => return self.maybeDoProposal(slot),
^
/Users/kaichen/Documents/projects/zeam/pkgs/node/src/utils.zig:41:33: 0x1097525b7 in callback (zeam)
return self.onIntervalCb(self.ptr, self.interval);
^
/Users/kaichen/.cache/zig/p/libxev-0.0.0-86vtc-zkEgB7uv1i0Sa6ytJETZQi_lHJrImu9mLb9moi/src/backend/kqueue.zig:401:42: 0x1096a5003 in run (zeam)
const action = c.callback(c.userdata, self, c, .{ .timer = .expiration });
^
/Users/kaichen/Documents/projects/zeam/pkgs/cli/src/node.zig:179:18: 0x1097089b6 in main (zeam)
try clock.run();
^
/Users/kaichen/.local/share/zigup/0.14.1/files/lib/std/start.zig:660:37: 0x10970c8d1 in main (zeam)
const result = root.main() catch |err| {
^
???:?:?: 0x7ff81987552f in ??? (???)
Unwind information for `???:0x7ff81987552f` was not available, trace may be incomplete
???:?:?: 0x0 in ??? (???)
zsh: abort ./zig-out/bin/zeam node --custom_genesis ~/genesis --node_id 0validator-config.yaml - name: "zeam_0"
privkey: "a94f5374fce5edbc8e2a8697c15331677e6ebf0b906c5aa9515b9c5cb11b1e0f"
enrFields:
ip: "127.0.0.1"
quic: 8080
seq: 1
count: 1
- name: "zeam_1"
privkey: "c2bbdac5e876b3e9d4b8b6b8c2bbdac5e876b3e9d4b8b6b8c2bbdac5e876b3e9"
enrFields:
ip: "127.0.0.1"
quic: 8081
seq: 1
count: 1 |
But this PR needs to get in before |
@g11tech @gballet this crash is from when processing slot 13436853, we calculate missed_slots = 13436853 - 0 - 1 = 13436852 which the creates 13+ million entries in historical_block_hashes and justified_slots arrays |
|
We kind of need a proper state pruning/compression |
I feel this slot value is not correct, it may calculate error. |
g11tech
left a comment
There was a problem hiding this comment.
the issue that is reported will require handling at ssz level for higher sizes, so approving this PR.
also this issue should not occur in the CI sim job because genesis generator should generate genesis near to the current time and hence shouldn't lead to these many entries int the state
|
why is it not correct? |
Ooh I see now the slot calculation is using std.time.milliTimestamp() which returns the current Unix timestamp in milliseconds could be why genesis should be in seconds? not milliseconds so let say we should have used relative time from genesis not absolute |
|
@g11tech @bomanaps It seems generator tool issue. ethpandaops/eth-beacon-genesis#36 (comment) |
For option 2, chatted with @bomanaps https://github.com/blockblaz/zeam/pull/174/files#diff-895524c7b22520ba1e9165ec5829107ac8df0fa539458b5e530fcda35470dcd2R25 we already have this struct, we can create it manually and set genesis time just using Zig, and run nodes. It seems we don't need genesis tool in the test or CI. @g11tech what is your thought? |
point of this PR is to run a CI job so that we can consume genesis from genesis generator, otherwise we already have |

This pull request introduces a new "lean_node" cmd to the CLI, enabling lightweight node startup using YAML configuration files for genesis, bootnodes, and validator assignments. It adds YAML parsing support throughout the codebase, updates build dependencies, and provides test fixtures and utilities for configuration management. Additionally, there are minor changes to libp2p networking and Rust transport initialization which enable QUIC transport. The original "beam" cmd may be changed to "--dev" flag in future.
There is a problem that the rust libp2p doesn't use the private key in the ENR, which will be fixed in other PR.
Fix #76