diff --git a/Node/Cargo.lock b/Node/Cargo.lock index c793dbf..022fd5a 100644 --- a/Node/Cargo.lock +++ b/Node/Cargo.lock @@ -438,7 +438,7 @@ checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -578,7 +578,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -591,11 +591,11 @@ dependencies = [ "alloy-sol-macro-input", "const-hex", "heck 0.5.0", - "indexmap 2.4.0", + "indexmap 2.5.0", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "syn-solidity", "tiny-keccak", ] @@ -613,7 +613,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.76", + "syn 2.0.77", "syn-solidity", ] @@ -941,7 +941,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "synstructure 0.13.1", ] @@ -953,7 +953,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1215,7 +1215,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1226,13 +1226,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1297,7 +1297,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1664,7 +1664,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1905,7 +1905,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1929,7 +1929,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -1940,7 +1940,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2057,7 +2057,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2120,7 +2120,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2300,7 +2300,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2422,7 +2422,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2685,7 +2685,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -2869,7 +2869,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.4.0", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -2888,7 +2888,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.4.0", + "indexmap 2.5.0", "slab", "tokio", "tokio-util", @@ -3196,9 +3196,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", @@ -3409,9 +3409,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -4422,7 +4422,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5073,7 +5073,7 @@ dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5154,7 +5154,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5358,7 +5358,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5586,7 +5586,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -5639,9 +5639,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "async-io 2.3.4", "async-std", @@ -5660,9 +5660,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand 0.8.5", @@ -5677,15 +5677,15 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ "libc", "once_cell", "socket2 0.5.7", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6245,7 +6245,7 @@ dependencies = [ "rustls-webpki 0.102.7", "security-framework", "security-framework-sys", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", "winapi", ] @@ -6503,7 +6503,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -6849,7 +6849,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -6871,9 +6871,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.76" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -6889,7 +6889,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -6927,7 +6927,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -7059,7 +7059,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -7162,7 +7162,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -7211,7 +7211,7 @@ dependencies = [ "tokio", "tokio-rustls", "tungstenite", - "webpki-roots 0.26.3", + "webpki-roots 0.26.5", ] [[package]] @@ -7250,7 +7250,7 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.5.0", "toml_datetime", "winnow", ] @@ -7303,7 +7303,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -7609,7 +7609,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -7643,7 +7643,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7695,9 +7695,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ "rustls-pki-types", ] @@ -8113,7 +8113,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] [[package]] @@ -8133,5 +8133,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.77", ] diff --git a/Node/src/ethereum_l1/abi/PreconfTaskManager.json b/Node/src/ethereum_l1/abi/PreconfTaskManager.json index 2c21138..ff282af 100644 --- a/Node/src/ethereum_l1/abi/PreconfTaskManager.json +++ b/Node/src/ethereum_l1/abi/PreconfTaskManager.json @@ -1 +1 @@ -[{"type":"constructor","inputs":[{"name":"_serviceManager","type":"address","internalType":"contract IPreconfServiceManager"},{"name":"_registry","type":"address","internalType":"contract IPreconfRegistry"},{"name":"_taikoL1","type":"address","internalType":"contract ITaikoL1"},{"name":"_beaconBlockRootContract","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"function","name":"getFallbackPreconfer","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"getLookahead","inputs":[],"outputs":[{"name":"","type":"tuple[64]","internalType":"struct IPreconfTaskManager.LookaheadEntry[64]","components":[{"name":"timestamp","type":"uint48","internalType":"uint48"},{"name":"prevTimestamp","type":"uint48","internalType":"uint48"},{"name":"preconfer","type":"address","internalType":"address"}]}],"stateMutability":"view"},{"type":"function","name":"getLookaheadParamsForEpoch","inputs":[{"name":"epochTimestamp","type":"uint256","internalType":"uint256"},{"name":"validatorBLSPubKeys","type":"bytes[32]","internalType":"bytes[32]"}],"outputs":[{"name":"","type":"tuple[]","internalType":"struct IPreconfTaskManager.LookaheadSetParam[]","components":[{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"preconfer","type":"address","internalType":"address"}]}],"stateMutability":"view"},{"type":"function","name":"initialize","inputs":[{"name":"_taikoToken","type":"address","internalType":"contract IERC20"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"isLookaheadRequired","inputs":[{"name":"epochTimestamp","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"newBlockProposal","inputs":[{"name":"blockParams","type":"bytes","internalType":"bytes"},{"name":"txList","type":"bytes","internalType":"bytes"},{"name":"lookaheadPointer","type":"uint256","internalType":"uint256"},{"name":"lookaheadSetParams","type":"tuple[]","internalType":"struct IPreconfTaskManager.LookaheadSetParam[]","components":[{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"preconfer","type":"address","internalType":"address"}]}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"proveIncorrectLookahead","inputs":[{"name":"lookaheadPointer","type":"uint256","internalType":"uint256"},{"name":"slotTimestamp","type":"uint256","internalType":"uint256"},{"name":"validatorBLSPubKey","type":"bytes","internalType":"bytes"},{"name":"validatorInclusionProof","type":"tuple","internalType":"struct EIP4788.InclusionProof","components":[{"name":"validator","type":"bytes32[8]","internalType":"bytes32[8]"},{"name":"validatorIndex","type":"uint256","internalType":"uint256"},{"name":"validatorProof","type":"bytes32[]","internalType":"bytes32[]"},{"name":"validatorsRoot","type":"bytes32","internalType":"bytes32"},{"name":"nr_validators","type":"uint256","internalType":"uint256"},{"name":"beaconStateProof","type":"bytes32[]","internalType":"bytes32[]"},{"name":"beaconStateRoot","type":"bytes32","internalType":"bytes32"},{"name":"beaconBlockProofForState","type":"bytes32[]","internalType":"bytes32[]"},{"name":"beaconBlockProofForProposerIndex","type":"bytes32[]","internalType":"bytes32[]"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"proveIncorrectPreconfirmation","inputs":[{"name":"taikoBlockMetadata","type":"tuple","internalType":"struct ITaikoL1.BlockMetadata","components":[{"name":"l1Hash","type":"bytes32","internalType":"bytes32"},{"name":"difficulty","type":"bytes32","internalType":"bytes32"},{"name":"blobHash","type":"bytes32","internalType":"bytes32"},{"name":"extraData","type":"bytes32","internalType":"bytes32"},{"name":"depositsHash","type":"bytes32","internalType":"bytes32"},{"name":"coinbase","type":"address","internalType":"address"},{"name":"id","type":"uint64","internalType":"uint64"},{"name":"gasLimit","type":"uint32","internalType":"uint32"},{"name":"timestamp","type":"uint64","internalType":"uint64"},{"name":"l1Height","type":"uint64","internalType":"uint64"},{"name":"minTier","type":"uint16","internalType":"uint16"},{"name":"blobUsed","type":"bool","internalType":"bool"},{"name":"parentMetaHash","type":"bytes32","internalType":"bytes32"},{"name":"sender","type":"address","internalType":"address"}]},{"name":"header","type":"tuple","internalType":"struct IPreconfTaskManager.PreconfirmationHeader","components":[{"name":"blockId","type":"uint256","internalType":"uint256"},{"name":"chainId","type":"uint256","internalType":"uint256"},{"name":"txListHash","type":"bytes32","internalType":"bytes32"}]},{"name":"signature","type":"bytes","internalType":"bytes"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"Initialized","inputs":[{"name":"version","type":"uint8","indexed":false,"internalType":"uint8"}],"anonymous":false},{"type":"event","name":"LookaheadUpdated","inputs":[{"name":"","type":"tuple[]","indexed":false,"internalType":"struct IPreconfTaskManager.LookaheadSetParam[]","components":[{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"preconfer","type":"address","internalType":"address"}]}],"anonymous":false},{"type":"event","name":"ProvedIncorrectLookahead","inputs":[{"name":"poster","type":"address","indexed":true,"internalType":"address"},{"name":"timestamp","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"disputer","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"ProvedIncorrectPreconfirmation","inputs":[{"name":"preconfer","type":"address","indexed":true,"internalType":"address"},{"name":"blockId","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"disputer","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"error","name":"BeaconBlockProofForProposerIndex","inputs":[]},{"type":"error","name":"BeaconBlockProofForStateFailed","inputs":[]},{"type":"error","name":"BeaconStateProofFailed","inputs":[]},{"type":"error","name":"ExpectedValidatorMustNotBeSlashed","inputs":[]},{"type":"error","name":"InvalidLookaheadPointer","inputs":[]},{"type":"error","name":"InvalidSlotTimestamp","inputs":[]},{"type":"error","name":"InvalidValidatorBLSPubKey","inputs":[]},{"type":"error","name":"LookaheadEntryIsCorrect","inputs":[]},{"type":"error","name":"MetadataMismatch","inputs":[]},{"type":"error","name":"MissedDisputeWindow","inputs":[]},{"type":"error","name":"PosterAlreadySlashedForTheEpoch","inputs":[]},{"type":"error","name":"PreconferNotRegistered","inputs":[]},{"type":"error","name":"PreconfirmationChainIdMismatch","inputs":[]},{"type":"error","name":"PreconfirmationIsCorrect","inputs":[]},{"type":"error","name":"SenderIsNotTheFallbackPreconfer","inputs":[]},{"type":"error","name":"SenderIsNotThePreconfer","inputs":[]},{"type":"error","name":"ValidatorProofFailed","inputs":[]}] \ No newline at end of file +[{"type":"function","name":"forcePushLookahead","inputs":[{"name":"lookaheadSetParams","type":"tuple[]","internalType":"struct IPreconfTaskManager.LookaheadSetParam[]","components":[{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"preconfer","type":"address","internalType":"address"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"getFallbackPreconfer","inputs":[{"name":"epochTimestamp","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"getLookaheadBuffer","inputs":[],"outputs":[{"name":"","type":"tuple[64]","internalType":"struct IPreconfTaskManager.LookaheadBufferEntry[64]","components":[{"name":"isFallback","type":"bool","internalType":"bool"},{"name":"timestamp","type":"uint40","internalType":"uint40"},{"name":"prevTimestamp","type":"uint40","internalType":"uint40"},{"name":"preconfer","type":"address","internalType":"address"}]}],"stateMutability":"view"},{"type":"function","name":"getLookaheadForEpoch","inputs":[{"name":"epochTimestamp","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"address[32]","internalType":"address[32]"}],"stateMutability":"view"},{"type":"function","name":"getLookaheadParamsForEpoch","inputs":[{"name":"epochTimestamp","type":"uint256","internalType":"uint256"},{"name":"validatorBLSPubKeys","type":"bytes[32]","internalType":"bytes[32]"}],"outputs":[{"name":"","type":"tuple[]","internalType":"struct IPreconfTaskManager.LookaheadSetParam[]","components":[{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"preconfer","type":"address","internalType":"address"}]}],"stateMutability":"view"},{"type":"function","name":"getLookaheadPoster","inputs":[{"name":"epochTimestamp","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"getLookaheadTail","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"type":"function","name":"isLookaheadRequired","inputs":[{"name":"epochTimestamp","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"type":"function","name":"newBlockProposal","inputs":[{"name":"blockParams","type":"bytes","internalType":"bytes"},{"name":"txList","type":"bytes","internalType":"bytes"},{"name":"lookaheadPointer","type":"uint256","internalType":"uint256"},{"name":"lookaheadSetParams","type":"tuple[]","internalType":"struct IPreconfTaskManager.LookaheadSetParam[]","components":[{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"preconfer","type":"address","internalType":"address"}]}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"proveIncorrectLookahead","inputs":[{"name":"lookaheadPointer","type":"uint256","internalType":"uint256"},{"name":"slotTimestamp","type":"uint256","internalType":"uint256"},{"name":"validatorBLSPubKey","type":"bytes","internalType":"bytes"},{"name":"validatorInclusionProof","type":"tuple","internalType":"struct EIP4788.InclusionProof","components":[{"name":"validator","type":"bytes32[8]","internalType":"bytes32[8]"},{"name":"validatorIndex","type":"uint256","internalType":"uint256"},{"name":"validatorProof","type":"bytes32[]","internalType":"bytes32[]"},{"name":"validatorsRoot","type":"bytes32","internalType":"bytes32"},{"name":"nr_validators","type":"uint256","internalType":"uint256"},{"name":"beaconStateProof","type":"bytes32[]","internalType":"bytes32[]"},{"name":"beaconStateRoot","type":"bytes32","internalType":"bytes32"},{"name":"beaconBlockProofForState","type":"bytes32[]","internalType":"bytes32[]"},{"name":"beaconBlockProofForProposerIndex","type":"bytes32[]","internalType":"bytes32[]"}]}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"proveIncorrectPreconfirmation","inputs":[{"name":"taikoBlockMetadata","type":"tuple","internalType":"struct ITaikoL1.BlockMetadata","components":[{"name":"l1Hash","type":"bytes32","internalType":"bytes32"},{"name":"difficulty","type":"bytes32","internalType":"bytes32"},{"name":"blobHash","type":"bytes32","internalType":"bytes32"},{"name":"extraData","type":"bytes32","internalType":"bytes32"},{"name":"depositsHash","type":"bytes32","internalType":"bytes32"},{"name":"coinbase","type":"address","internalType":"address"},{"name":"id","type":"uint64","internalType":"uint64"},{"name":"gasLimit","type":"uint32","internalType":"uint32"},{"name":"timestamp","type":"uint64","internalType":"uint64"},{"name":"l1Height","type":"uint64","internalType":"uint64"},{"name":"minTier","type":"uint16","internalType":"uint16"},{"name":"blobUsed","type":"bool","internalType":"bool"},{"name":"parentMetaHash","type":"bytes32","internalType":"bytes32"},{"name":"sender","type":"address","internalType":"address"},{"name":"blobTxListOffset","type":"uint32","internalType":"uint32"},{"name":"blobTxListLength","type":"uint32","internalType":"uint32"}]},{"name":"header","type":"tuple","internalType":"struct IPreconfTaskManager.PreconfirmationHeader","components":[{"name":"blockId","type":"uint256","internalType":"uint256"},{"name":"chainId","type":"uint256","internalType":"uint256"},{"name":"txListHash","type":"bytes32","internalType":"bytes32"}]},{"name":"signature","type":"bytes","internalType":"bytes"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"LookaheadUpdated","inputs":[{"name":"","type":"tuple[]","indexed":false,"internalType":"struct IPreconfTaskManager.LookaheadSetParam[]","components":[{"name":"timestamp","type":"uint256","internalType":"uint256"},{"name":"preconfer","type":"address","internalType":"address"}]}],"anonymous":false},{"type":"event","name":"ProvedIncorrectLookahead","inputs":[{"name":"poster","type":"address","indexed":true,"internalType":"address"},{"name":"timestamp","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"disputer","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"ProvedIncorrectPreconfirmation","inputs":[{"name":"preconfer","type":"address","indexed":true,"internalType":"address"},{"name":"blockId","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"disputer","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"error","name":"InvalidLookaheadPointer","inputs":[]},{"type":"error","name":"InvalidSlotTimestamp","inputs":[]},{"type":"error","name":"LookaheadEntryIsCorrect","inputs":[]},{"type":"error","name":"LookaheadIsNotRequired","inputs":[]},{"type":"error","name":"MetadataMismatch","inputs":[]},{"type":"error","name":"MissedDisputeWindow","inputs":[]},{"type":"error","name":"PosterAlreadySlashedOrLookaheadIsEmpty","inputs":[]},{"type":"error","name":"PreconferNotRegistered","inputs":[]},{"type":"error","name":"PreconfirmationChainIdMismatch","inputs":[]},{"type":"error","name":"PreconfirmationIsCorrect","inputs":[]},{"type":"error","name":"SenderIsNotThePreconfer","inputs":[]}] \ No newline at end of file diff --git a/Node/src/ethereum_l1/execution_layer.rs b/Node/src/ethereum_l1/execution_layer.rs index 5403671..ceeb93d 100644 --- a/Node/src/ethereum_l1/execution_layer.rs +++ b/Node/src/ethereum_l1/execution_layer.rs @@ -456,14 +456,33 @@ impl ExecutionLayer { Ok(params) } + pub async fn get_lookahead_preconfer_addresses_for_epoch( + &self, + epoch_begin_timestamp: u64, + ) -> Result, Error> { + let provider = self.create_provider(); + let contract = + PreconfTaskManager::new(self.contract_addresses.avs.preconf_task_manager, provider); + + let lookahead = contract + .getLookaheadForEpoch(U256::from(epoch_begin_timestamp)) + .call() + .await? + ._0; + Ok(lookahead + .iter() + .map(|addr| addr.into_array()) + .collect::>()) + } + pub async fn get_lookahead_preconfer_buffer( &self, - ) -> Result<[PreconfTaskManager::LookaheadEntry; 64], Error> { + ) -> Result<[PreconfTaskManager::LookaheadBufferEntry; 64], Error> { let provider = self.create_provider(); let contract = PreconfTaskManager::new(self.contract_addresses.avs.preconf_task_manager, provider); - let lookahead = contract.getLookahead().call().await?._0; + let lookahead = contract.getLookaheadBuffer().call().await?._0; Ok(lookahead) } diff --git a/Node/src/node/mod.rs b/Node/src/node/mod.rs index 8e475b0..a18cca1 100644 --- a/Node/src/node/mod.rs +++ b/Node/src/node/mod.rs @@ -41,7 +41,7 @@ pub struct Node { mev_boost: MevBoost, epoch: Epoch, cl_lookahead: Vec, - lookahead_preconfer_buffer: Option<[PreconfTaskManager::LookaheadEntry; 64]>, + lookahead_preconfer_buffer: Option<[PreconfTaskManager::LookaheadBufferEntry; 64]>, l2_slot_duration_sec: u64, preconfirmed_blocks: Arc>>, is_preconfer_now: Arc, @@ -63,7 +63,7 @@ impl Node { bls_service: Arc, ) -> Result { let current_epoch = ethereum_l1.slot_clock.get_current_epoch()?; - let operator = Operator::new(ethereum_l1.clone()); + let operator = Operator::new(ethereum_l1.clone(), current_epoch)?; Ok(Self { taiko, node_rx: Some(node_rx), @@ -225,6 +225,7 @@ impl Node { if let Some(block) = preconfirmed_blocks.get(&block_proposed.block_id) { //Signature is already verified on precof insertion if block.commit_hash != block_proposed.tx_list_hash { + // TODO: simulate proveIncorrectPreconfirmation instead of checking info!( "Block tx_list_hash is not correct for block_id: {}. Calling proof of incorrect preconfirmation.", block_proposed.block_id @@ -266,17 +267,10 @@ impl Node { self.epoch, current_epoch ); - let current_epoch_timestamp = self - .ethereum_l1 - .slot_clock - .get_epoch_begin_timestamp(current_epoch)?; - self.epoch = current_epoch; - self.operator = Operator::new(self.ethereum_l1.clone()); - self.operator - .update_preconfer_lookahead_for_epoch(current_epoch_timestamp, &self.cl_lookahead) - .await?; + self.operator = Operator::new(self.ethereum_l1.clone(), current_epoch)?; + self.operator.update_preconfer_lookahead_for_epoch().await?; self.cl_lookahead = self .ethereum_l1 @@ -293,7 +287,7 @@ impl Node { let current_slot = self.ethereum_l1.slot_clock.get_current_slot()?; - match self.operator.get_status(current_slot)? { + match self.operator.get_status(current_slot).await? { OperatorStatus::PreconferAndProposer => { self.preconfirm_last_slot().await?; } @@ -314,7 +308,6 @@ impl Node { async fn get_lookahead_params( &mut self, - current_epoch_timestamp: u64, ) -> Result<(u64, Vec), Error> { let current_timestamp = std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH)? @@ -336,11 +329,7 @@ impl Node { "get_lookahead_params: Preconfer not found in lookahead" ))? as u64; - if self - .operator - .should_post_lookahead(current_epoch_timestamp) - .await? - { + if self.operator.should_post_lookahead().await? { let lookahead_params = self .ethereum_l1 .execution_layer @@ -412,12 +401,7 @@ impl Node { self.ethereum_l1.slot_clock.get_current_slot()? ); - let current_epoch_timestamp = self - .ethereum_l1 - .slot_clock - .get_epoch_begin_timestamp(self.epoch)?; - let (lookahead_pointer, lookahead_params) = - self.get_lookahead_params(current_epoch_timestamp).await?; + let (lookahead_pointer, lookahead_params) = self.get_lookahead_params().await?; let pending_tx_lists = self.taiko.get_pending_l2_tx_lists().await?; if pending_tx_lists.tx_list_bytes.is_empty() { diff --git a/Node/src/node/operator.rs b/Node/src/node/operator.rs index cf4d760..6aae173 100644 --- a/Node/src/node/operator.rs +++ b/Node/src/node/operator.rs @@ -1,14 +1,15 @@ -use crate::ethereum_l1::{ - execution_layer::PreconfTaskManager::LookaheadSetParam, slot_clock::Slot, EthereumL1, +use crate::{ + ethereum_l1::{slot_clock::Slot, EthereumL1}, + utils::types::*, }; use anyhow::Error; -use beacon_api_client::ProposerDuty; use std::sync::Arc; pub struct Operator { ethereum_l1: Arc, + epoch_begin_timestamp: u64, lookahead_required_contract_called: bool, - lookahead_params: Vec, + lookahead_preconfer_addresses: Vec, l1_slots_per_epoch: u64, } @@ -19,20 +20,20 @@ pub enum Status { } impl Operator { - pub fn new(ethereum_l1: Arc) -> Self { + pub fn new(ethereum_l1: Arc, epoch: Epoch) -> Result { let l1_slots_per_epoch = ethereum_l1.slot_clock.get_slots_per_epoch(); - Self { + let epoch_begin_timestamp = ethereum_l1.slot_clock.get_epoch_begin_timestamp(epoch)?; + Ok(Self { ethereum_l1, + epoch_begin_timestamp, lookahead_required_contract_called: false, - lookahead_params: vec![], + lookahead_preconfer_addresses: vec![], l1_slots_per_epoch, - } + }) } - pub fn get_status(&self, slot: Slot) -> Result { - // TODO: use the other lookahead parameters, which have entry for every slot - // below can have less than 32 entries - if self.lookahead_params.len() < self.l1_slots_per_epoch as usize { + pub async fn get_status(&mut self, slot: Slot) -> Result { + if self.lookahead_preconfer_addresses.len() < self.l1_slots_per_epoch as usize { return Err(anyhow::anyhow!( "Operator::get_status: Not enough lookahead params" )); @@ -40,7 +41,14 @@ impl Operator { let slot = slot % self.l1_slots_per_epoch; - if self.lookahead_params[slot as usize].preconfer + // If the preconfer address is zero, next epoch preconfer may start preconfirming. + // Update the lookahead to check if it is assigned as a preconfer for the rest slots + // of the current epoch. + if self.lookahead_preconfer_addresses[slot as usize] == PRECONFER_ADDRESS_ZERO { + self.update_preconfer_lookahead_for_epoch().await?; + } + + if self.lookahead_preconfer_addresses[slot as usize] == self.ethereum_l1.execution_layer.get_preconfer_address() { if self.is_the_final_slot_to_preconf(slot) { @@ -54,20 +62,17 @@ impl Operator { fn is_the_final_slot_to_preconf(&self, slot_mod_slots_per_epoch: Slot) -> bool { slot_mod_slots_per_epoch == self.l1_slots_per_epoch - 1 - || self.lookahead_params[(slot_mod_slots_per_epoch + 1) as usize].preconfer + || self.lookahead_preconfer_addresses[(slot_mod_slots_per_epoch + 1) as usize] != self.ethereum_l1.execution_layer.get_preconfer_address() } - pub async fn should_post_lookahead( - &mut self, - epoch_begin_timestamp: u64, - ) -> Result { + pub async fn should_post_lookahead(&mut self) -> Result { if !self.lookahead_required_contract_called { self.lookahead_required_contract_called = true; if self .ethereum_l1 .execution_layer - .is_lookahead_required(epoch_begin_timestamp) + .is_lookahead_required(self.epoch_begin_timestamp) .await? { return Ok(true); @@ -76,15 +81,11 @@ impl Operator { Ok(false) } - pub async fn update_preconfer_lookahead_for_epoch( - &mut self, - epoch_begin_timestamp: u64, - cl_lookahead: &[ProposerDuty], - ) -> Result<(), Error> { - self.lookahead_params = self + pub async fn update_preconfer_lookahead_for_epoch(&mut self) -> Result<(), Error> { + self.lookahead_preconfer_addresses = self .ethereum_l1 .execution_layer - .get_lookahead_params_for_epoch_using_cl_lookahead(epoch_begin_timestamp, cl_lookahead) + .get_lookahead_preconfer_addresses_for_epoch(self.epoch_begin_timestamp) .await?; Ok(()) } diff --git a/Node/src/utils/types.rs b/Node/src/utils/types.rs index ba1605b..bd7be18 100644 --- a/Node/src/utils/types.rs +++ b/Node/src/utils/types.rs @@ -1,7 +1,11 @@ -pub type PreconferAddress = [u8; 20]; pub type ECDSASignature = [u8; 65]; // ECDSA 65 bytes signature pub type BLSCompressedPublicKey = [u8; 48]; +pub type PreconferAddress = [u8; 20]; +pub const PRECONFER_ADDRESS_ZERO: PreconferAddress = [0u8; 20]; + +pub type Epoch = u64; + // TODO for future usage // pub type BLSUncompressedPublicKey = [u8; 96]; // pub type BLSSignature = [u8; 96];