Skip to content

Commit c1e0659

Browse files
lukaszrzasikmrainss-espls148rob-maron
authored
Merge the release-20251106 into current main (#3772)
* relay log & logic * fmt * revert bad relay logic change * Update staging genesis file * Upgrade genesis file * Upgrade proposal genesis file * Add genesis files for upgrade proposer and new node * Add the initial stake table for upgrade test * Copy data dir into orchestrator's container * Add modified DA to genesis file * Increase DA genesis files * 0.4 to 0.5 upgrade genesis files * Adapt genesis file to new upgrade version * Add stake table contract addr in genesis file * Revert "Add stake table contract addr in genesis file" This reverts commit 5827101. * Set genesis_version to 0.4 * fix hotshotconfig deserialization * clippy * fix tests * fix * fix * remove redundant attribute * Adjust upgrade views * Adjust upgrade view again * CDN -> TCP (#3709) * cdn upgrade + b compat * lints * CDN backwards compatibility - use cleaner build (#3717) fix CDN backwards compatibility tag * logging * cancel dep handles correctly (#3733) * cancel dep handles correctly * log * Typos --------- Co-authored-by: Lukasz Rzasik <lukasz.rzasik@gmail.com> * better startup logging * Add more verbose logs to compute_state_update * Add DRB logs (#3753) * Add DRB logs * Adjust log * add version to block header trait and use it for the DRB calculation * discard value from storage if incorrect * fix * Backport 3756 to release 20251106 (#3759) * Update state: apply header, verify, store (#3756) * Update state: apply header, verify, store * Remove `compute_state_update` * Fix errors * First apply, then verify and store (cherry picked from commit e574cda) * Fix error after cherry pick * Fix `test_vote_dependency_handle` * clippy: fix type complexity error (#3718) * clippy: fix type complexity error --------- Co-authored-by: MRain <linmrain@gmail.com> Co-authored-by: ss-es <155648797+ss-es@users.noreply.github.com> Co-authored-by: pls148 <184445976+pls148@users.noreply.github.com> Co-authored-by: rob-maron <132852777+rob-maron@users.noreply.github.com> Co-authored-by: Rob <rob@espressosys.com> Co-authored-by: Brendon Fish <bfish713@gmail.com> Co-authored-by: Mathis <sveitser@gmail.com>
1 parent 5166bca commit c1e0659

File tree

14 files changed

+265
-9
lines changed

14 files changed

+265
-9
lines changed

.typos.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ extend-exclude = [
1717
"sdks/go/types/common/consts.go",
1818
"sequencer/src/genesis.rs",
1919
"data/insta_snapshots",
20+
"data/initial_stake_table.toml",
21+
"data/initial_staging_stake_table.toml",
22+
"data/genesis/staging.toml",
23+
"data/genesis/staging-proposer.toml",
24+
"data/genesis/staging-new.toml",
25+
"data/genesis/demo-da-committees.toml",
2026
"tests/proof_of_stake.rs",
21-
"data/genesis/demo-da-committees.toml"
2227
]
2328

2429
[default.extend-words]

crates/hotshot/task-impls/src/quorum_proposal/handlers.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ pub struct ProposalDependencyHandle<TYPES: NodeType, V: Versions> {
124124

125125
/// Number of blocks in an epoch, zero means there are no epochs
126126
pub epoch_height: u64,
127+
128+
pub cancel_receiver: Receiver<()>,
127129
}
128130

129131
impl<TYPES: NodeType, V: Versions> ProposalDependencyHandle<TYPES, V> {
@@ -842,7 +844,16 @@ impl<TYPES: NodeType, V: Versions> HandleDepOutput for ProposalDependencyHandle<
842844
#[allow(clippy::no_effect_underscore_binding, clippy::too_many_lines)]
843845
#[instrument(skip_all, fields(id = self.id, view_number = *self.view_number, latest_proposed_view = *self.latest_proposed_view))]
844846
async fn handle_dep_result(self, res: Self::Output) {
845-
let result = self.handle_proposal_deps(&res).await;
847+
let mut cancel_receiver = self.cancel_receiver.clone();
848+
let result = tokio::select! {
849+
result = self.handle_proposal_deps(&res) => {
850+
result
851+
}
852+
_ = cancel_receiver.recv() => {
853+
tracing::warn!("Proposal dependency task cancelled");
854+
return;
855+
}
856+
};
846857
if result.is_err() {
847858
log!(result);
848859
self.print_proposal_events(&res)

crates/hotshot/task-impls/src/quorum_proposal/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions>
431431
id: self.id,
432432
view_start_time: Instant::now(),
433433
epoch_height: self.epoch_height,
434+
cancel_receiver,
434435
},
435436
);
436437
self.proposal_dependencies

crates/hotshot/task-impls/src/quorum_vote/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,15 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES> + 'static, V: Versions> Handl
120120
#[allow(clippy::too_many_lines)]
121121
#[instrument(skip_all, fields(id = self.id, view = *self.view_number))]
122122
async fn handle_dep_result(self, res: Self::Output) {
123-
let result = self.handle_vote_deps(&res).await;
123+
let mut cancel_receiver = self.cancel_receiver.clone();
124+
let result = tokio::select! { result = self.handle_vote_deps(&res) => {
125+
result
126+
}
127+
_ = cancel_receiver.recv() => {
128+
tracing::warn!("Vote dependency task cancelled");
129+
return;
130+
}
131+
};
124132
if result.is_err() {
125133
log!(result);
126134
self.print_vote_events(&res)

crates/hotshot/testing/tests/tests_1/vote_dependency_handle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ async fn test_vote_dependency_handle() {
7777
];
7878

7979
let (event_sender, mut event_receiver) = broadcast(1024);
80-
let (_, cancel_receiver) = broadcast(1);
80+
let (_sender, cancel_receiver) = broadcast(1);
8181
let view_number = ViewNumber::new(node_id);
8282

8383
let vote_dependency_handle_state =

data/genesis/staging-new.toml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
base_version = "0.4"
2+
upgrade_version = "0.5"
3+
genesis_version = "0.4"
4+
epoch_height = 3000
5+
drb_difficulty = 5000000000
6+
drb_upgrade_difficulty = 5000000000
7+
epoch_start_block = 1
8+
9+
[[da_committees]]
10+
start_version = "0.5"
11+
start_epoch = 114
12+
13+
[[da_committees.committee]]
14+
state_ver_key = "SCHNORR_VER_KEY~SH_6UHYUqQYsJEHKxSSmKZxXYApnLKho21-0aUSi0xmDxqm7ooRNpI5xpFdHSQReY1n0g4w9SIKjJK4HG92NIKc"
15+
16+
[da_committees.committee.stake_table_entry]
17+
stake_key = "BLS_VER_KEY~64_Y8QFPwAVvCZ5wTwt0i84X3Q1QP7klDfrfnmGf0Csf-MxquDLjT_R0ekVjRt3Vgi_q3psgOk2JMt7hG9kLEmn_KZ54T4wpV28JcxPcvdv33u5HiwYV2j3WOMfQUK0ACgrGMxyRtgjB2_N4MAaRhmbi8l1TnggtkX1w1GmKfhSc"
18+
stake_amount = "0x1"
19+
20+
[[da_committees.committee]]
21+
state_ver_key = "SCHNORR_VER_KEY~Vgs-osonoQBj8GGb4erBqK6G2v0Q3qk21Pb16B1h9RfKm6N3UnnaIU7NO6lk-Pk63udiQ85ulDekUrmr-Qd7J2Y"
22+
23+
[da_committees.committee.stake_table_entry]
24+
stake_key = "BLS_VER_KEY~qwEP63srzoRpSf7ahV27nz8JL90W5q3KhyPJhTY75Sir9JiHkF2JQBZ_1iJlTNOfprZ-cXh7GB4irI00hvExFiSQbTPomSRUnFxugn5I5FbOT7vxiXZiZ3pEhFbzFqAHCY57RtaPbqFBNmMzlueUUtxF0Cf-Sy3uVcAaWF7TB6Jy"
25+
stake_amount = "0x1"
26+
27+
28+
[stake_table]
29+
capacity = 200
30+
31+
[chain_config]
32+
chain_id = 888888888
33+
base_fee = "1 wei"
34+
max_block_size = "1mb"
35+
fee_recipient = "0x0000000000000000000000000000000000000000"
36+
fee_contract = "0xa15bb66138824a1c7167f5e85b957d04dd34e468"
37+
stake_table_contract = "0xed1db453c3156ff3155a97ad217b3087d5dc5f6e"
38+
39+
[header]
40+
timestamp = "1970-01-01T00:00:00Z"
41+
42+
[header.chain_config]
43+
chain_id = 888888888
44+
base_fee = "1 wei"
45+
max_block_size = "1mb"
46+
fee_recipient = "0x0000000000000000000000000000000000000000"
47+
fee_contract = "0xa15bb66138824a1c7167f5e85b957d04dd34e468"
48+
stake_table_contract = "0xed1db453c3156ff3155a97ad217b3087d5dc5f6e"
49+
50+
[l1_finalized]
51+
number = 0
52+
53+
[[upgrade]]
54+
start_voting_view = 0
55+
stop_voting_view = 999999999
56+
start_proposing_view = 0
57+
stop_proposing_view = 1
58+
59+
version = "0.5"
60+
61+
[upgrade.da]
62+
[upgrade.da.chain_config]
63+
chain_id = 888888888
64+
base_fee = "1 wei"
65+
max_block_size = "1mb"
66+
fee_recipient = "0x0000000000000000000000000000000000000000"
67+
fee_contract = "0xa15bb66138824a1c7167f5e85b957d04dd34e468"
68+
stake_table_contract = "0xed1db453c3156ff3155a97ad217b3087d5dc5f6e"

data/genesis/staging-proposer.toml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
base_version = "0.4"
2+
upgrade_version = "0.5"
3+
genesis_version = "0.4"
4+
epoch_height = 3000
5+
drb_difficulty = 5000000000
6+
drb_upgrade_difficulty = 5000000000
7+
epoch_start_block = 1
8+
9+
[[da_committees]]
10+
start_version = "0.5"
11+
start_epoch = 114
12+
13+
[[da_committees.committee]]
14+
state_ver_key = "SCHNORR_VER_KEY~SH_6UHYUqQYsJEHKxSSmKZxXYApnLKho21-0aUSi0xmDxqm7ooRNpI5xpFdHSQReY1n0g4w9SIKjJK4HG92NIKc"
15+
16+
[da_committees.committee.stake_table_entry]
17+
stake_key = "BLS_VER_KEY~64_Y8QFPwAVvCZ5wTwt0i84X3Q1QP7klDfrfnmGf0Csf-MxquDLjT_R0ekVjRt3Vgi_q3psgOk2JMt7hG9kLEmn_KZ54T4wpV28JcxPcvdv33u5HiwYV2j3WOMfQUK0ACgrGMxyRtgjB2_N4MAaRhmbi8l1TnggtkX1w1GmKfhSc"
18+
stake_amount = "0x1"
19+
20+
[[da_committees.committee]]
21+
state_ver_key = "SCHNORR_VER_KEY~Vgs-osonoQBj8GGb4erBqK6G2v0Q3qk21Pb16B1h9RfKm6N3UnnaIU7NO6lk-Pk63udiQ85ulDekUrmr-Qd7J2Y"
22+
23+
[da_committees.committee.stake_table_entry]
24+
stake_key = "BLS_VER_KEY~qwEP63srzoRpSf7ahV27nz8JL90W5q3KhyPJhTY75Sir9JiHkF2JQBZ_1iJlTNOfprZ-cXh7GB4irI00hvExFiSQbTPomSRUnFxugn5I5FbOT7vxiXZiZ3pEhFbzFqAHCY57RtaPbqFBNmMzlueUUtxF0Cf-Sy3uVcAaWF7TB6Jy"
25+
stake_amount = "0x1"
26+
27+
28+
[stake_table]
29+
capacity = 200
30+
31+
[chain_config]
32+
chain_id = 888888888
33+
base_fee = "1 wei"
34+
max_block_size = "1mb"
35+
fee_recipient = "0x0000000000000000000000000000000000000000"
36+
fee_contract = "0xa15bb66138824a1c7167f5e85b957d04dd34e468"
37+
stake_table_contract = "0xed1db453c3156ff3155a97ad217b3087d5dc5f6e"
38+
39+
[header]
40+
timestamp = "1970-01-01T00:00:00Z"
41+
42+
[header.chain_config]
43+
chain_id = 888888888
44+
base_fee = "1 wei"
45+
max_block_size = "1mb"
46+
fee_recipient = "0x0000000000000000000000000000000000000000"
47+
fee_contract = "0xa15bb66138824a1c7167f5e85b957d04dd34e468"
48+
stake_table_contract = "0xed1db453c3156ff3155a97ad217b3087d5dc5f6e"
49+
50+
[l1_finalized]
51+
number = 0
52+
53+
[[upgrade]]
54+
start_voting_view = 0
55+
stop_voting_view = 999999999
56+
start_proposing_view = 334000
57+
stop_proposing_view = 335000
58+
59+
version = "0.5"
60+
61+
[upgrade.da]
62+
[upgrade.da.chain_config]
63+
chain_id = 888888888
64+
base_fee = "1 wei"
65+
max_block_size = "1mb"
66+
fee_recipient = "0x0000000000000000000000000000000000000000"
67+
fee_contract = "0xa15bb66138824a1c7167f5e85b957d04dd34e468"
68+
stake_table_contract = "0xed1db453c3156ff3155a97ad217b3087d5dc5f6e"

data/genesis/staging.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
base_version = "0.2"
2-
upgrade_version = "0.3"
3-
genesis_version = "0.2"
1+
base_version = "0.4"
2+
upgrade_version = "0.4"
3+
genesis_version = "0.4"
4+
epoch_height = 3000
5+
drb_difficulty = 5000000000
6+
drb_upgrade_difficulty = 5000000000
7+
epoch_start_block = 1
48

59
[stake_table]
610
capacity = 200
@@ -11,6 +15,7 @@ base_fee = "1 wei"
1115
max_block_size = "1mb"
1216
fee_recipient = "0x0000000000000000000000000000000000000000"
1317
fee_contract = "0xa15bb66138824a1c7167f5e85b957d04dd34e468"
18+
stake_table_contract = "0xed1db453c3156ff3155a97ad217b3087d5dc5f6e"
1419

1520
[header]
1621
timestamp = "1970-01-01T00:00:00Z"
@@ -21,6 +26,7 @@ base_fee = "1 wei"
2126
max_block_size = "1mb"
2227
fee_recipient = "0x0000000000000000000000000000000000000000"
2328
fee_contract = "0xa15bb66138824a1c7167f5e85b957d04dd34e468"
29+
stake_table_contract = "0xed1db453c3156ff3155a97ad217b3087d5dc5f6e"
2430

2531
[l1_finalized]
2632
number = 0
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[[public_keys]]
2+
stake_table_key = "BLS_VER_KEY~64_Y8QFPwAVvCZ5wTwt0i84X3Q1QP7klDfrfnmGf0Csf-MxquDLjT_R0ekVjRt3Vgi_q3psgOk2JMt7hG9kLEmn_KZ54T4wpV28JcxPcvdv33u5HiwYV2j3WOMfQUK0ACgrGMxyRtgjB2_N4MAaRhmbi8l1TnggtkX1w1GmKfhSc"
3+
state_ver_key = "SCHNORR_VER_KEY~SH_6UHYUqQYsJEHKxSSmKZxXYApnLKho21-0aUSi0xmDxqm7ooRNpI5xpFdHSQReY1n0g4w9SIKjJK4HG92NIKc"
4+
da = true
5+
stake = 1
6+
7+
[[public_keys]]
8+
stake_table_key = "BLS_VER_KEY~qwEP63srzoRpSf7ahV27nz8JL90W5q3KhyPJhTY75Sir9JiHkF2JQBZ_1iJlTNOfprZ-cXh7GB4irI00hvExFiSQbTPomSRUnFxugn5I5FbOT7vxiXZiZ3pEhFbzFqAHCY57RtaPbqFBNmMzlueUUtxF0Cf-Sy3uVcAaWF7TB6Jy"
9+
state_ver_key = "SCHNORR_VER_KEY~Vgs-osonoQBj8GGb4erBqK6G2v0Q3qk21Pb16B1h9RfKm6N3UnnaIU7NO6lk-Pk63udiQ85ulDekUrmr-Qd7J2Y"
10+
da = true
11+
stake = 2
12+
13+
[[public_keys]]
14+
stake_table_key = "BLS_VER_KEY~OgoV0DKrVMKYbGrnun5P6QGLicYtu-YAfmd-jmMjGQbr5L1nBUgOu-iOrnFiQIKQzB7hD_7N7VYP8OJCOeU_GOlEJDpNFJEUrn636VB1hqc2xXUrTy9nr6pf-IBQSOQnBu-DynNfdfWl79kJ3mPGLUnLrEZxzmx_rX5mbbzHfplw"
15+
state_ver_key = "SCHNORR_VER_KEY~rCGxwXIrWN1QbYXykJgDw4c1a0vNCglqbSTeevaZcSX_vDiOl0ncKIhbsDhASx0EaWX67ZgaXOoCq2V87cpXCNw"
16+
da = true
17+
stake = 3
18+
19+
[[public_keys]]
20+
stake_table_key = "BLS_VER_KEY~epsA2EWk47kIH9LJAXFaHmkV7Z5w1WVCVW9OxbUt_AagVOVHW_d234iIRW6daMzNG2smomQm7JatnCcAVenEBUz3qBMh6yZ45W5unxRcn7cqXWLz0lsXFlexuoZuGPUaj3zxCiLZ8d357kFvxMxMssRapfr0E_G1byeN9nOQNKRp"
21+
state_ver_key = "SCHNORR_VER_KEY~7nMR1Q6NekFNRqGdYlahjDrU-53laZ8CZeSK6UMOZAyVAK662M9m9-a4Z-XqB9lfqIDIkSdf7E9Egk_KDfDlJ9o"
22+
da = true
23+
stake = 4
24+
25+
[[public_keys]]
26+
stake_table_key = "BLS_VER_KEY~vwNZL5rU6wGCuOy30Xa9n3lFXJttQCD_rANGqFLZJy5TiQJS6Qc-JL-eyP_HVSnowzplfo3Gs8vmMrIL_jMwF43DMcn55drU3QC4yQRWxun6mXHoDSaXbByBdNXwmFAdD7fW6pNn84a0rZphp8MUshO6OdIrHk8RlvCk_E-sBQ8R"
27+
state_ver_key = "SCHNORR_VER_KEY~TLltPAWf8roNMaOPTB9A-rro0v23YOXYDE9u-lShCR61V-Rt3O0gFoJiogCklHQxEoPj6neeH4fgg1Y0rdwZDlc"
28+
da = false
29+
stake = 5
30+
31+
[[public_keys]]
32+
stake_table_key = "BLS_VER_KEY~c1umxNjnCB_hv-Dp5x9f-xKRFGKMkirBJ5FM5fPg_SVyKsL7-L4Ck9Nbn07LirWRVsITXOLthnEiyV8zU8v4G8SjloCxndsebX5ceCe99ouBSdWKrX-3HCLVVRu3nHECMyyLsfkFXJ4jArj32mypkyRvIl1LCad2BqdrBcCUdwUj"
33+
state_ver_key = "SCHNORR_VER_KEY~wwKnID5q18ep0hq6W7o-7wrMDXZTrgfnQYgepVae-wGAuG6Tk6SxKFOfRvkDdGaxc3t_OZ_n_5BJGtnSgwhLJ78"
34+
da = false
35+
stake = 1
36+
37+
[[public_keys]]
38+
stake_table_key = "BLS_VER_KEY~spX3M9wYMTmD3tab2OmJZ9mWZ9JoVowwmlgdQSzQeQVpb2Rk5n3lV6NFLQIX9CU8N3EY0pLiq0QSs-r18adEJRgQ3lwkNeyVdP9ygEPywjd7BP8_cKhB3tGkGY-QUM4JurjNycKMqe2ll-fr9Efwe3aEZrVraQ6jnCrVxoVaoAxI"
39+
state_ver_key = "SCHNORR_VER_KEY~UhNBmtpJwHb3S6q8PNAJyLsFM2XGNvxF2WHn1FW8nR6EXtgn4sh27Jd-Rl2JHqQjJDIyiv4ShcT8eNXYCWFPBMU"
40+
da = false
41+
stake = 2
42+
43+
[[public_keys]]
44+
stake_table_key = "BLS_VER_KEY~l7zCaYVtwUonbbjI4sCoIWMFRzyxIrbBPi4YLB8kgRrcXNV1lnzrBE46aBnL53ClAml7Zdu8MqXYfkYJjL4TB8Xu5iaaE8eBL4TBXWlFDIdAFX1yVfsdfEdOgXMoY8sXCyp3lSqBzdE1VOvUhN7T4BzeyQzvEG_mSiEBoeAzU6Si"
45+
state_ver_key = "SCHNORR_VER_KEY~otOjmDNCPM5CWaUjuS-F4dyv0lTLnURQZ85VI16oFhz-ReDtSe1FlbcSAIAtM8QFzjtVhpQTPDUDVt8qT2mqAv4"
46+
da = false
47+
stake = 3
48+
49+
[[public_keys]]
50+
stake_table_key = "BLS_VER_KEY~4EUfjINdNHRUd8StbsAXX-FWWUHzWBBCR2-Fyy7kVSYtrJ-dwsTb6kgN-PyQkNwGpues4SVVscUNFO64G-xhFQNIw0tJf2lcGa0siqBNq0gJIBSgIh5mzFAwIoCTxd4phmdCsnl8IexJA6_z0l1kEc7NLJoPJg0iQKx2OaAnAw1X"
51+
state_ver_key = "SCHNORR_VER_KEY~r7PVea-fE9BQPKMjcsnUQ7EQbpV0Ug-kvcDn_JUK3yhjD31SsH6tE6Iuc3mYDumzcfzZCf9B3RWcZJFen-BSLrI"
52+
da = false
53+
stake = 4
54+
55+
[[public_keys]]
56+
stake_table_key = "BLS_VER_KEY~QM_ZEKUVz-f-GDSs01iFaPaVcldrQhYazqEV2u2uHQktpoNEQxWTu4EFLsT5RjrHF8jauheW4CMP9tn_t4gfIF9P7SPc4ELiTcJ7PQe5rihXfqNFJFXEbJUodX1sMQIM3oqoUPYdCDa-Ge2P3BQJxh6YOrEubH0BpzTXn17CtwNG"
57+
state_ver_key = "SCHNORR_VER_KEY~KGMmPGswouTEgKhC7V_R8EuQJZRTBzrrdtzDSTzLTQ6GIvfQHvL_AiXC0JU3Oo5q7xp52PNi33kFv0mMRihlIf4"
58+
da = false
59+
stake = 5

docker/orchestrator.Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ ENV ESPRESSO_ORCHESTRATOR_MAX_PROPOSE_TIME=30s
2121
# failure).
2222
ENV ESPRESSO_ORCHESTRATOR_NEXT_VIEW_TIMEOUT=5m
2323

24+
COPY data /data
25+
2426
CMD [ "/bin/orchestrator"]
2527
HEALTHCHECK --interval=1s --timeout=1s --retries=100 CMD curl --fail http://localhost:${ESPRESSO_ORCHESTRATOR_PORT}/healthcheck || exit 1
2628

0 commit comments

Comments
 (0)