Skip to content

Commit 9d264f7

Browse files
authored
update bob (#4502)
unblocks finishing opening the channels in #4472
2 parents 1d7b6cd + a0f5c65 commit 9d264f7

File tree

3 files changed

+118
-3
lines changed

3 files changed

+118
-3
lines changed

deployments/deployments.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"bob": {
2525
"address": "union1lsn5mm3hf9cxqetp2dx47x7tq4kvxpk66e7v8c4d2j4cajrg7hsq0v877s",
2626
"height": 461757,
27-
"commit": "65cc0bc088732faafeaa372f5018ca92c691ed04"
27+
"commit": "c9a0b82990813698dd9601099beb6477b64768e0"
2828
},
2929
"ethereum": {
3030
"address": "union1a3gz55rhudakew7p3hccjarn8rk70guxnuqrw58tl00f5x4kyl9qj8t3xw",
@@ -101,7 +101,7 @@
101101
"bob": {
102102
"address": "union1lsn5mm3hf9cxqetp2dx47x7tq4kvxpk66e7v8c4d2j4cajrg7hsq0v877s",
103103
"height": 354886,
104-
"commit": "21d7cd4dd6bfe66bd7334eb2055469944a3b0b91"
104+
"commit": "c9a0b82990813698dd9601099beb6477b64768e0"
105105
},
106106
"ethereum": {
107107
"address": "union1a3gz55rhudakew7p3hccjarn8rk70guxnuqrw58tl00f5x4kyl9qj8t3xw",

lib/bob-light-client-types/src/header.rs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,50 @@ impl L2Header {
115115
keccak256(self.rlp_bytes())
116116
}
117117
}
118+
119+
#[cfg(test)]
120+
mod tests {
121+
use hex_literal::hex;
122+
123+
use super::*;
124+
125+
#[test]
126+
fn hash() {
127+
let header = L2Header {
128+
parent_hash: hex!("2e0fa901f264102bd20c86822222f0e3be0e72517ddf8ecae5bb09717c542f33").into(),
129+
sha3_uncles: hex!("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347").into(),
130+
miner: hex!("4200000000000000000000000000000000000011").into(),
131+
state_root: hex!("1965c4276f2ee3e5e7f4190c1302835c630afeb7b1078f595ad80206d0901fc2").into(),
132+
transactions_root: hex!(
133+
"75418567809ce6cb380eebb1895034e31751b2eb691c2f4b170de50d25e8c061"
134+
).into(),
135+
receipts_root: hex!(
136+
"0d98745240a828bea4726880dca08008c87f95f6a55f7524861bb23917b0b6e7"
137+
).into(),
138+
logs_bloom: Box::new(hex!("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").into()),
139+
difficulty: 0_u64.into(),
140+
number: 16649144_u64.into(),
141+
gas_limit: 30000000,
142+
gas_used: 64887,
143+
timestamp: 1746160275,
144+
extra_data: hex!("00000000fa00000006").into(),
145+
mix_hash: hex!("a20ab72103cd88aefd65cb31a0c470a6a88e53b4d4da00b27503deb4580e128c").into(),
146+
nonce: hex!("0000000000000000").into(),
147+
base_fee_per_gas: 252_u64.into(),
148+
withdrawals_root: hex!(
149+
"56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
150+
).into(),
151+
blob_gas_used: 0,
152+
excess_blob_gas: 0,
153+
parent_beacon_block_root: hex!(
154+
"9467bee415d6385906410d33fc263b32ef2d4880f4a6c9559db669acfd325213"
155+
).into(),
156+
requests_hash: Nullable(None),
157+
};
158+
159+
let hash: H256 =
160+
hex!("8975fdc9d79a1ad20b7cca844ef06f25b4a61e76c8d0cef32121aff90dbdef53").into();
161+
162+
assert_eq!(hash, header.hash());
163+
}
164+
}

lib/bob-verifier/src/lib.rs

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub fn verify_l2_header_is_related_to_output_root_proof(
120120

121121
#[cfg(test)]
122122
mod tests {
123-
use bob_light_client_types::{ClientStateV1, Header};
123+
use bob_light_client_types::{header::Nullable, ClientStateV1, Header};
124124
use hex_literal::hex;
125125
use ibc_union_spec::ClientId;
126126
use unionlabs::encoding::{DecodeAs, Json};
@@ -237,4 +237,72 @@ mod tests {
237237

238238
assert_eq!(r2, Err(Error::HeaderNotFinalized));
239239
}
240+
241+
#[test]
242+
fn test_verify_l2_header_is_related_to_output_root_proof() {
243+
verify_l2_header_is_related_to_output_root_proof(
244+
&OutputRootProof {
245+
version: hex!("0000000000000000000000000000000000000000000000000000000000000000")
246+
.into(),
247+
state_root: hex!(
248+
"2ef85f4dfdbe515eb89fb7be3a156ea476483a17225039e5352bc72c9d9b5626"
249+
)
250+
.into(),
251+
message_passer_storage_root: hex!(
252+
"61f529e3532e620cdd166738d3c6ccf05f9fe70b9d943a45f9183c34f730a4be"
253+
)
254+
.into(),
255+
latest_block_hash: hex!(
256+
"ab1325306c1a2dea55f29320e30d76e43e99a167d4e74e9a5e9c18bad5127564"
257+
)
258+
.into(),
259+
},
260+
&L2Header {
261+
parent_hash: hex!(
262+
"885d2dc6e52bda916b3ca9dcca29c1048b3d29e7258467a0c195c240020fef0c"
263+
)
264+
.into(),
265+
sha3_uncles: hex!(
266+
"1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
267+
)
268+
.into(),
269+
miner: hex!("4200000000000000000000000000000000000011").into(),
270+
state_root: hex!(
271+
"2ef85f4dfdbe515eb89fb7be3a156ea476483a17225039e5352bc72c9d9b5626"
272+
)
273+
.into(),
274+
transactions_root: hex!(
275+
"8b6c76337a74cf1447e0ff1143606bcca0896d2e842dda04958e709bf55270be"
276+
)
277+
.into(),
278+
receipts_root: hex!(
279+
"351a05348a16ac245a8f9d8358f65f43f47bae4a1848e147a368b61ff3d86370"
280+
)
281+
.into(),
282+
logs_bloom: Box::new(hex!("00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000").into()),
283+
difficulty: 0_u64.into(),
284+
number: 16632000_u64.into(),
285+
gas_limit: 30000000,
286+
gas_used: 43887,
287+
timestamp: 1746125987,
288+
extra_data: hex!("00000000fa00000006").into(),
289+
mix_hash: hex!("8b8f9d75ccac014aae0e18afbcc54bc2c6e9e3aba801c81bdc359fb7e0b7f414")
290+
.into(),
291+
nonce: hex!("0000000000000000").into(),
292+
base_fee_per_gas: 252_u64.into(),
293+
withdrawals_root: hex!(
294+
"56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421"
295+
)
296+
.into(),
297+
blob_gas_used: 0,
298+
excess_blob_gas: 0,
299+
parent_beacon_block_root: hex!(
300+
"a4052c2062dd55cd35cd70061fbfd403863f1a08ac41df04f686fbf0460dd879"
301+
)
302+
.into(),
303+
requests_hash: Nullable::from(None),
304+
},
305+
)
306+
.unwrap();
307+
}
240308
}

0 commit comments

Comments
 (0)