Skip to content
Draft
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
25fd3f5
store reward merkle tree v2 in memory instead of postgres
ss-es Jan 26, 2026
8ac7918
Adjust genesis file
lukaszrzasik Jan 26, 2026
7c93373
Use V4
lukaszrzasik Jan 26, 2026
bcee80c
update genesis
ss-es Jan 27, 2026
871171d
Revert "update genesis"
lukaszrzasik Jan 27, 2026
e1748b7
add persistence and garbage collection
ss-es Jan 28, 2026
84b86b7
move light client query to separate thread
ss-es Jan 28, 2026
f46fb20
move contract fetching into NodeState methods, switch to balances for
ss-es Jan 29, 2026
d524642
add migrations
ss-es Jan 29, 2026
a9aa145
oops
ss-es Jan 29, 2026
6f60af5
add new endpoint for latest proof
ss-es Jan 29, 2026
4d4ad2a
fix build
ss-es Jan 29, 2026
869620f
fix build
ss-es Jan 29, 2026
9e1eb3e
fix
ss-es Jan 29, 2026
dba8771
remove unnecessary tokio::spawn
ss-es Jan 29, 2026
4b3239b
fix reward api
ss-es Jan 30, 2026
c6ca037
add comments
ss-es Jan 30, 2026
1da547c
do not exit state update loop on failure to persist merkle proofs for
ss-es Jan 30, 2026
1119736
move save out of tx again
ss-es Jan 30, 2026
2e8b943
fix request/response implementation
ss-es Feb 1, 2026
5c7025e
fix catchup
ss-es Feb 2, 2026
7df65ad
avoid hashset allocation for missing accounts
ss-es Feb 2, 2026
9ccaf59
ensure required accounts are present in tree before returning in catchup
ss-es Feb 2, 2026
8636a76
remove merkle tree variant; only catchup from key/value pairs
ss-es Feb 3, 2026
a83017b
[breaking] change enum to struct
ss-es Feb 3, 2026
7b5bce4
implement migrate_reward_merkle_tree_v2
imabdulbasit Feb 4, 2026
f3af1e6
clippy
imabdulbasit Feb 4, 2026
10c7a90
reorder state storage loop
ss-es Feb 4, 2026
6092615
load previous reward merkle tree at the start of the state storage
ss-es Feb 4, 2026
182d884
check commitment against header
imabdulbasit Feb 4, 2026
370c855
run `migrate_reward_merkle_tree_v2` on startup
ss-es Feb 3, 2026
cc41363
fix initial read from table
ss-es Feb 4, 2026
6d4f304
check height before loading previous tree in state storage loop
ss-es Feb 4, 2026
e54ad6b
update names
ss-es Feb 6, 2026
6447598
Merge branch 'main' into ss/in-memory-merkle-tree
ss-es Feb 12, 2026
f6c219b
Require global permit to reconstruct merkle tree (#3942)
ss-es Feb 13, 2026
417a2be
Reapply "update names"
ss-es Feb 13, 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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ indexmap = { version = "2", features = ["serde"] }
lazy_static = "1"
libp2p-identity = { version = "0.2", features = ["ed25519", "serde"] }
libp2p-swarm-derive = { version = "0.35" }
moka = { version = "0.12.12", features = ["future"] }
memoize = { version = "0.4", features = ["full"] }
moka = { version = "0.12.12", features = ["future"] }
multiaddr = { version = "0.18" }
num_cpus = "1"
parking_lot = { version = "0.12", features = ["send_guard"] }
Expand Down
4 changes: 2 additions & 2 deletions data/genesis/staging.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ base_fee = "1 wei"
max_block_size = "1mb"
fee_recipient = "0x0000000000000000000000000000000000000000"
fee_contract = "0xa15bb66138824a1c7167f5e85b957d04dd34e468"
stake_table_contract = "0xed1db453c3156ff3155a97ad217b3087d5dc5f6e"
stake_table_contract = "0x12975173b87f7595ee45dffb2ab812ece596bf84"

[header]
timestamp = "1970-01-01T00:00:00Z"
Expand All @@ -26,7 +26,7 @@ base_fee = "1 wei"
max_block_size = "1mb"
fee_recipient = "0x0000000000000000000000000000000000000000"
fee_contract = "0xa15bb66138824a1c7167f5e85b957d04dd34e468"
stake_table_contract = "0xed1db453c3156ff3155a97ad217b3087d5dc5f6e"
stake_table_contract = "0x12975173b87f7595ee45dffb2ab812ece596bf84"

[l1_finalized]
number = 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CREATE TABLE reward_merkle_tree_v2_bincode (
height BIGINT PRIMARY KEY,
serialized_bytes BYTEA
);

CREATE TABLE reward_merkle_tree_v2_proofs (
height BIGINT,
account BYTEA NOT NULL,
proof BYTEA
);

ALTER TABLE
reward_merkle_tree_v2_proofs
ADD
CONSTRAINT reward_merkle_tree_v2_proofs_pk PRIMARY KEY (height, account);
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE TABLE reward_merkle_tree_v2_bincode (
height BIGINT PRIMARY KEY,
serialized_bytes BLOB
);

CREATE TABLE reward_merkle_tree_v2_proofs (
height BIGINT,
account BLOB NOT NULL,
proof BLOB,
PRIMARY KEY (height, account)
);
21 changes: 18 additions & 3 deletions sequencer/api/reward.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
[route.get_latest_reward_balance]
PATH = ["reward-balance/latest/:address"]
[route.get_reward_merkle_tree_v2]
PATH = ["reward-merkle-tree-v2/:height"]
METHOD = "GET"
":height" = "Integer"
DOC = "Get the snapshot of this node's RewardMerkleTreeV2 at the given hotshot block height, serialized as a RewardMerkleTreeV2Data."

[route.get_latest_reward_account_proof]
PATH = ["proof/latest/:address"]
METHOD = "GET"
":address" = "Literal"
DOC = "Get current balance in reward state. Expected parameter is an Ethereum address in hex format."
DOC = """The endpoint returns the Merkle proof for a reward account :address at the latest block height
finalized by the light client contract. This endpoint only returns a `RewardAccountQueryDataV2`,
containing the balance and a `RewardAccountProofV2`. This proof is based on `RewardMerkleTreeV2`, which uses the
Keccak256 hashing algorithm."""

[route.get_reward_balance]
PATH = ["reward-balance/:height/:address"]
":address" = "Literal"
":height" = "Integer"
DOC = "Get balance in reward state at a specific height. Expected parameters are height which is an integer and an Ethereum address in hex format"

[route.get_latest_reward_balance]
PATH = ["reward-balance/latest/:address"]
":address" = "Literal"
DOC = "Get current balance in reward state. Expected parameter is an Ethereum address in hex format."

[route.get_reward_account_proof]
PATH = ["proof/:height/:address"]
":address" = "Literal"
Expand Down
Loading
Loading