diff --git a/Cargo.lock b/Cargo.lock index 87b72b2e..473c44c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -103,7 +103,7 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "alloy" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-consensus 1.4.3", "alloy-contract", @@ -166,7 +166,7 @@ dependencies = [ [[package]] name = "alloy-consensus" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-eips 1.4.3", "alloy-primitives", @@ -205,7 +205,7 @@ dependencies = [ [[package]] name = "alloy-consensus-any" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-consensus 1.4.3", "alloy-eips 1.4.3", @@ -218,7 +218,7 @@ dependencies = [ [[package]] name = "alloy-contract" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-consensus 1.4.3", "alloy-dyn-abi", @@ -330,7 +330,7 @@ dependencies = [ [[package]] name = "alloy-eips" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-eip2124", "alloy-eip2930", @@ -385,7 +385,7 @@ dependencies = [ [[package]] name = "alloy-genesis" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-eips 1.4.3", "alloy-primitives", @@ -438,7 +438,7 @@ dependencies = [ [[package]] name = "alloy-json-rpc" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -477,7 +477,7 @@ dependencies = [ [[package]] name = "alloy-network" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-consensus 1.4.3", "alloy-consensus-any 1.4.3", @@ -514,7 +514,7 @@ dependencies = [ [[package]] name = "alloy-network-primitives" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-consensus 1.4.3", "alloy-eips 1.4.3", @@ -623,7 +623,7 @@ dependencies = [ [[package]] name = "alloy-provider" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-chains", "alloy-consensus 1.4.3", @@ -668,7 +668,7 @@ dependencies = [ [[package]] name = "alloy-pubsub" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-json-rpc 1.4.3", "alloy-primitives", @@ -733,7 +733,7 @@ dependencies = [ [[package]] name = "alloy-rpc-client" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-json-rpc 1.4.3", "alloy-primitives", @@ -769,7 +769,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-primitives", "alloy-rpc-types-anvil", @@ -785,7 +785,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types-anvil" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth 1.4.3", @@ -806,7 +806,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types-any" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-consensus-any 1.4.3", "alloy-rpc-types-eth 1.4.3", @@ -827,7 +827,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types-debug" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-primitives", "derive_more 2.1.1", @@ -851,7 +851,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types-engine" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-consensus 1.4.3", "alloy-eips 1.4.3", @@ -887,7 +887,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types-eth" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-consensus 1.4.3", "alloy-consensus-any 1.4.3", @@ -920,7 +920,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types-trace" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth 1.4.3", @@ -933,7 +933,7 @@ dependencies = [ [[package]] name = "alloy-rpc-types-txpool" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-primitives", "alloy-rpc-types-eth 1.4.3", @@ -954,7 +954,7 @@ dependencies = [ [[package]] name = "alloy-serde" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-primitives", "serde", @@ -993,7 +993,7 @@ dependencies = [ [[package]] name = "alloy-signer" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-primitives", "async-trait", @@ -1007,7 +1007,7 @@ dependencies = [ [[package]] name = "alloy-signer-local" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-consensus 1.4.3", "alloy-network 1.4.3", @@ -1118,7 +1118,7 @@ dependencies = [ [[package]] name = "alloy-transport" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-json-rpc 1.4.3", "auto_impl", @@ -1154,7 +1154,7 @@ dependencies = [ [[package]] name = "alloy-transport-http" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-json-rpc 1.4.3", "alloy-transport 1.4.3", @@ -1168,7 +1168,7 @@ dependencies = [ [[package]] name = "alloy-transport-ipc" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-json-rpc 1.4.3", "alloy-pubsub", @@ -1187,7 +1187,7 @@ dependencies = [ [[package]] name = "alloy-transport-ws" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "alloy-pubsub", "alloy-transport 1.4.3", @@ -1247,7 +1247,7 @@ dependencies = [ [[package]] name = "alloy-tx-macros" version = "1.4.3" -source = "git+https://github.com/alloy-rs/alloy#10c14a18908a8a92f8e8c0fda0d9091e86e4befc" +source = "git+https://github.com/alloy-rs/alloy#7496fd9f6f7ab7d17c1cd1bae5598660702f107f" dependencies = [ "darling", "proc-macro2", @@ -5100,7 +5100,7 @@ dependencies = [ [[package]] name = "guest-executor" version = "0.1.0" -source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#ab25a628d31439c24a7e3673c34319c546d2682c" +source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#403401c045c42a8681431ca7009bd57d62e1f1df" dependencies = [ "alloy-consensus 1.0.41", "alloy-evm", @@ -5541,7 +5541,7 @@ dependencies = [ [[package]] name = "host-executor" version = "0.1.0" -source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#ab25a628d31439c24a7e3673c34319c546d2682c" +source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#403401c045c42a8681431ca7009bd57d62e1f1df" dependencies = [ "alloy-chains", "alloy-consensus 1.0.41", @@ -6814,7 +6814,7 @@ dependencies = [ "rcgen", "ring 0.17.14", "rustls 0.23.36", - "rustls-webpki 0.103.8", + "rustls-webpki 0.103.9", "thiserror 2.0.17", "x509-parser", "yasna", @@ -7186,7 +7186,7 @@ dependencies = [ [[package]] name = "mpt" version = "0.1.0" -source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#ab25a628d31439c24a7e3673c34319c546d2682c" +source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#403401c045c42a8681431ca7009bd57d62e1f1df" dependencies = [ "alloy-primitives", "alloy-rlp", @@ -8887,7 +8887,7 @@ dependencies = [ [[package]] name = "primitives" version = "0.1.0" -source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#ab25a628d31439c24a7e3673c34319c546d2682c" +source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#403401c045c42a8681431ca7009bd57d62e1f1df" dependencies = [ "alloy-eips 1.0.41", "alloy-genesis 1.0.41", @@ -9222,7 +9222,7 @@ dependencies = [ [[package]] name = "provider" version = "0.1.0" -source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#ab25a628d31439c24a7e3673c34319c546d2682c" +source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#403401c045c42a8681431ca7009bd57d62e1f1df" dependencies = [ "alloy-json-rpc 1.0.41", "alloy-provider 1.0.41", @@ -10379,7 +10379,7 @@ dependencies = [ [[package]] name = "rpc-db" version = "0.1.0" -source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#ab25a628d31439c24a7e3673c34319c546d2682c" +source = "git+https://github.com/ProjectZKM/reth-processor?branch=feat%2Fslot-state-check#403401c045c42a8681431ca7009bd57d62e1f1df" dependencies = [ "alloy-consensus 1.0.41", "alloy-primitives", @@ -10583,7 +10583,7 @@ dependencies = [ "once_cell", "ring 0.17.14", "rustls-pki-types", - "rustls-webpki 0.103.8", + "rustls-webpki 0.103.9", "subtle", "zeroize", ] @@ -10611,9 +10611,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ "web-time", "zeroize", @@ -10631,9 +10631,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.8" +version = "0.103.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" +checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" dependencies = [ "ring 0.17.14", "rustls-pki-types", @@ -14012,7 +14012,7 @@ dependencies = [ [[package]] name = "zkm-build" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "anyhow", "cargo_metadata", @@ -14023,7 +14023,7 @@ dependencies = [ [[package]] name = "zkm-core-executor" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "anyhow", "bincode", @@ -14061,7 +14061,7 @@ dependencies = [ [[package]] name = "zkm-core-machine" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "bincode", "cfg-if", @@ -14113,7 +14113,7 @@ dependencies = [ [[package]] name = "zkm-cuda" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "bincode", "ctrlc", @@ -14131,7 +14131,7 @@ dependencies = [ [[package]] name = "zkm-curves" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "cfg-if", "curve25519-dalek", @@ -14155,7 +14155,7 @@ dependencies = [ [[package]] name = "zkm-derive" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "quote", "syn 1.0.109", @@ -14164,7 +14164,7 @@ dependencies = [ [[package]] name = "zkm-lib" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "bincode", "cfg-if", @@ -14177,7 +14177,7 @@ dependencies = [ [[package]] name = "zkm-primitives" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "bincode", "hex", @@ -14195,7 +14195,7 @@ dependencies = [ [[package]] name = "zkm-prover" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "anyhow", "bincode", @@ -14233,7 +14233,7 @@ dependencies = [ [[package]] name = "zkm-recursion-circuit" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "hashbrown 0.14.5", "itertools 0.13.0", @@ -14266,7 +14266,7 @@ dependencies = [ [[package]] name = "zkm-recursion-compiler" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "backtrace", "itertools 0.13.0", @@ -14287,7 +14287,7 @@ dependencies = [ [[package]] name = "zkm-recursion-core" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "backtrace", "ff 0.13.1", @@ -14324,7 +14324,7 @@ dependencies = [ [[package]] name = "zkm-recursion-derive" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "quote", "syn 1.0.109", @@ -14333,7 +14333,7 @@ dependencies = [ [[package]] name = "zkm-recursion-gnark-ffi" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "anyhow", "bincode", @@ -14357,7 +14357,7 @@ dependencies = [ [[package]] name = "zkm-sdk" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "alloy-primitives", "alloy-signer 1.4.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -14404,7 +14404,7 @@ dependencies = [ [[package]] name = "zkm-stark" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "arrayref", "hashbrown 0.14.5", @@ -14446,7 +14446,7 @@ dependencies = [ [[package]] name = "zkm-verifier" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "anyhow", "ark-bn254", @@ -14481,7 +14481,7 @@ dependencies = [ [[package]] name = "zkm-zkvm" version = "1.2.3" -source = "git+https://github.com/ProjectZKM/Ziren#64c30dda3cfd3e9e08f0988519f3a7f2ced5a398" +source = "git+https://github.com/ProjectZKM/Ziren#60249400e523f0deb5b5c0c308a7327bba86d6d5" dependencies = [ "bincode", "cfg-if", diff --git a/circuits/README.md b/circuits/README.md index 9115a675..5cb4ec7c 100644 --- a/circuits/README.md +++ b/circuits/README.md @@ -222,7 +222,10 @@ After calling the [`proceedWithdraw`](https://github.com/GOATNetwork/bitvm2-L2-c ``` export BITCOIN_NETWORK=regtest export GENESIS_SEQUENCER_COMMIT_TXID=$(cat ./data/commit-chain/commit_info.json.0 | jq -r .genesis_txid) + export LATEST_SEQUENCER_COMMIT_TXID=$(cat ./data/commit-chain/commit_info.json.2 | jq -r .txid) +export OPERATOR_BLOCKHASH_COMMIT_TXID=$(cat ./data/commit-chain/commit_info.json.2 | jq -r .txid) + export HEADER_CHAIN_INPUT_PROOF="data/header-chain/0-116000.bin" export COMMIT_CHAIN_INPUT_PROOF="data/commit-chain/2-1.bin" export STATE_CHAIN_INPUT_PROOF="data/state-chain/9511050-10.bin" diff --git a/circuits/operator-proof/guest/src/main.rs b/circuits/operator-proof/guest/src/main.rs index 88b7e4a9..91852187 100644 --- a/circuits/operator-proof/guest/src/main.rs +++ b/circuits/operator-proof/guest/src/main.rs @@ -2,13 +2,13 @@ zkm_zkvm::entrypoint!(main); use std::str::FromStr; use header_chain::{ - HeaderChainCircuitInput, SPV, CircuitTransaction, + HeaderChainCircuitInput, SPV, }; use alloy_primitives::{U256, Address}; use bitcoin_light_client_circuit::EthClientExecutorInput; use commit_chain::CommitChainCircuitInput; use state_chain::StateChainCircuitInput; -use bitcoin::{ScriptBuf, TxOut}; +use bitcoin::{ScriptBuf, TxOut, Transaction}; pub fn main() { // calculate operator public input: https://github.com/ProjectZKM/Ziren/blob/main/crates/sdk/src/utils.rs#L42 @@ -16,34 +16,33 @@ pub fn main() { let graph_id: [u8; 16] = zkm_zkvm::io::read::<[u8; 16]>(); let operator_genesis_sequencer_commit_txid: [u8; 32] = zkm_zkvm::io::read(); println!("read operator commit txn"); - let operator_latest_sequencer_commit_txn: CircuitTransaction = zkm_zkvm::io::read(); // private inputs - let latest_sequencer_commit_txid = operator_latest_sequencer_commit_txn.0.compute_txid(); // public input + let operator_latest_sequencer_commit_txn: Transaction = zkm_zkvm::io::read(); // private inputs + let latest_sequencer_commit_txid = operator_latest_sequencer_commit_txn.compute_txid(); // public input // https://github.com/KSlashh/BitVM/blob/v2/goat/src/transactions/watchtower_challenge.rs#L128 - let watchtower_challenge_txns: Vec = zkm_zkvm::io::read(); + let watchtower_challenge_txns: Vec = zkm_zkvm::io::read(); let watchtower_challenge_txn_pubkey: Vec = zkm_zkvm::io::read(); let watchtower_challenge_txn_scripts: Vec = zkm_zkvm::io::read(); let watchtower_challenge_txn_prev_outs: Vec = zkm_zkvm::io::read(); - let watchtower_challenge_txn_prev_indices: Vec = zkm_zkvm::io::read(); let operator_header_chain: HeaderChainCircuitInput = zkm_zkvm::io::read(); let operator_commit_chain: CommitChainCircuitInput = zkm_zkvm::io::read(); let operator_state_chain: StateChainCircuitInput = zkm_zkvm::io::read(); - let spv: SPV = zkm_zkvm::io::read(); + let spv_ss_commit: SPV = zkm_zkvm::io::read(); + let spv_operator_blockhash: SPV = zkm_zkvm::io::read(); let (btc_best_block_hash, constant, included_watchtowers) = bitcoin_light_client_circuit::propose_longest_chain( included_watchertowers, graph_id, operator_genesis_sequencer_commit_txid, - operator_latest_sequencer_commit_txn, watchtower_challenge_txns, watchtower_challenge_txn_pubkey, watchtower_challenge_txn_scripts, watchtower_challenge_txn_prev_outs, - watchtower_challenge_txn_prev_indices, operator_header_chain, operator_commit_chain, operator_state_chain, - spv, + spv_ss_commit, + spv_operator_blockhash, ); zkm_zkvm::io::commit(&btc_best_block_hash); diff --git a/circuits/operator-proof/host/src/lib.rs b/circuits/operator-proof/host/src/lib.rs index da323023..0bb624cb 100644 --- a/circuits/operator-proof/host/src/lib.rs +++ b/circuits/operator-proof/host/src/lib.rs @@ -11,9 +11,7 @@ use bitcoin_script::script; use borsh::BorshDeserialize; use client::btc_chain::BTCClient; use commit_chain::{CommitChainCircuitInput, CommitChainPrevProofType}; -use header_chain::{ - CircuitBlockHeader, CircuitTransaction, HeaderChainCircuitInput, HeaderChainPrevProofType, -}; +use header_chain::{CircuitBlockHeader, HeaderChainCircuitInput, HeaderChainPrevProofType}; use proof_builder::{LongRunning, ProofBuilder, ProofRequest}; use state_chain::{StateChainCircuitInput, StateChainPrevProofType}; use std::str::FromStr; @@ -44,6 +42,9 @@ pub struct Args { #[clap(long, env)] pub latest_sequencer_commit_txid: String, + #[clap(long, env)] + pub operator_blockhash_commit_txid: String, + #[clap(long, env)] pub genesis_sequencer_commit_txid: String, @@ -90,6 +91,7 @@ static ELF_ID: OnceLock = OnceLock::new(); pub async fn fetch_target_block_and_watchtower_tx( esplora_url: &str, latest_sequencer_commit_txid: &str, + operator_blockhash_commit_txid: &str, watchtower_challenge_init_txid: &String, watchtower_challenge_txids: &str, watchtower_public_keys: &str, @@ -97,29 +99,38 @@ pub async fn fetch_target_block_and_watchtower_tx( ) -> anyhow::Result<( u32, bitcoin::Block, + u32, + bitcoin::Block, + bitcoin::Transaction, bitcoin::Transaction, - Vec, + Vec, Vec, - Vec, Vec, Vec, )> { let watchtower_challenge_txids: Vec<&str> = watchtower_challenge_txids.split(",").collect(); let watchtower_public_keys: Vec<&str> = watchtower_public_keys.split(",").collect(); let btc_client = BTCClient::new(bitcoin_network, Some(&esplora_url)); + let latest_sequencer_commit_txid = Txid::from_str(&latest_sequencer_commit_txid).unwrap(); let operator_latest_sequencer_commit_txn = btc_client.get_tx(&latest_sequencer_commit_txid).await.unwrap().unwrap(); - let tx_status = btc_client.get_tx_status(&latest_sequencer_commit_txid).await.unwrap(); - let block_pos = tx_status.block_height.unwrap(); - tracing::info!("block height: {block_pos}"); - let target_block = btc_client.get_block_by_height(block_pos).await.unwrap(); + let block_pos_ss_commit = tx_status.block_height.unwrap(); + tracing::info!("block height: {block_pos_ss_commit}"); + let target_block_ss_commit = btc_client.get_block_by_height(block_pos_ss_commit).await.unwrap(); + + let operator_blockhash_commit_txid = Txid::from_str(&operator_blockhash_commit_txid).unwrap(); + let operator_blockhash_commit_txn = + btc_client.get_tx(&operator_blockhash_commit_txid).await.unwrap().unwrap(); + let tx_status = btc_client.get_tx_status(&operator_blockhash_commit_txid).await.unwrap(); + let block_pos_operator_blockhash = tx_status.block_height.unwrap(); + let target_block_operator_blockhash = + btc_client.get_block_by_height(block_pos_operator_blockhash).await.unwrap(); // --- watchtower_challenge_txns --- // let mut watchtower_challenge_txns = Vec::new(); let mut watchtower_challenge_txn_prev_outs: Vec = Vec::new(); - let mut watchtower_challenge_txn_prev_indices: Vec = Vec::new(); let mut watchtower_challenge_txn_pubkeys = Vec::new(); let mut watchtower_challenge_txn_scripts: Vec = Vec::new(); @@ -135,11 +146,10 @@ pub async fn fetch_target_block_and_watchtower_tx( let index = txn.input[0].previous_output.vout as usize; watchtower_challenge_txn_prev_outs .push(watchtower_challlenge_init_txn.output[index].clone()); - watchtower_challenge_txn_prev_indices.push(index); let public_key = PublicKey::from_str(pk).unwrap(); watchtower_challenge_txn_pubkeys.push(public_key.clone()); - watchtower_challenge_txns.push(CircuitTransaction(txn)); + watchtower_challenge_txns.push(txn); // https://github.com/GOATNetwork/BitVM/blob/GA/goat/src/transactions/watchtower_challenge.rs#L45 // generate_pay_to_pubkey_taproot_script @@ -155,12 +165,14 @@ pub async fn fetch_target_block_and_watchtower_tx( } Ok(( - block_pos, - target_block, + block_pos_ss_commit, + target_block_ss_commit, + block_pos_operator_blockhash, + target_block_operator_blockhash, operator_latest_sequencer_commit_txn, + operator_blockhash_commit_txn, watchtower_challenge_txns, watchtower_challenge_txn_prev_outs, - watchtower_challenge_txn_prev_indices, watchtower_challenge_txn_pubkeys, watchtower_challenge_txn_scripts, )) @@ -209,13 +221,17 @@ impl ProofBuilder for OperatorProofBuilder { commit_chain_input_proof, state_chain_input_proof, genesis_sequencer_commit_txid, - target_block, - block_pos, + + target_block_ss_commit, + block_pos_ss_commit, operator_latest_sequencer_commit_txn, + block_pos_operator_blockhash, + target_block_operator_blockhash, + operator_blockhash_commit_txn, + watchtower_challenge_txns, watchtower_challenge_txn_prev_outs, - watchtower_challenge_txn_prev_indices, watchtower_challenge_txn_pubkeys, watchtower_challenge_txn_scripts, .. @@ -293,9 +309,9 @@ impl ProofBuilder for OperatorProofBuilder { .collect::>() }; - let found = bitcoin_block_headers - .iter() - .position(|h| h.compute_block_hash() == *target_block.block_hash().as_byte_array()); + let found = bitcoin_block_headers.iter().position(|h| { + h.compute_block_hash() == *target_block_ss_commit.block_hash().as_byte_array() + }); tracing::info!("block found: {:?}", found); if found.is_none() { anyhow::bail!( @@ -304,11 +320,25 @@ impl ProofBuilder for OperatorProofBuilder { } tracing::info!("block headers: {:?}", bitcoin_block_headers.len()); - tracing::info!("construct spv"); - let spv = build_spv( + tracing::info!( + "construct spv for ss commit, {}", + operator_latest_sequencer_commit_txn.compute_txid() + ); + let spv_ss_commit = build_spv( &operator_latest_sequencer_commit_txn, - *block_pos, - target_block.clone(), + *block_pos_ss_commit, + target_block_ss_commit.clone(), + &bitcoin_block_headers, + ); + + tracing::info!( + "construct spv for operator blockhash commit, {}", + operator_blockhash_commit_txn.compute_txid() + ); + let spv_operator_blockhash = build_spv( + &operator_blockhash_commit_txn, + *block_pos_operator_blockhash, + target_block_operator_blockhash.clone(), &bitcoin_block_headers, ); @@ -329,12 +359,12 @@ impl ProofBuilder for OperatorProofBuilder { stdin.write(&watchtower_challenge_txn_pubkeys); stdin.write(&watchtower_challenge_txn_scripts); stdin.write(&watchtower_challenge_txn_prev_outs); - stdin.write(&watchtower_challenge_txn_prev_indices); stdin.write(&header_chain_input); stdin.write(&commit_chain_input); stdin.write(&state_chain_input); - stdin.write(&spv); + stdin.write(&spv_ss_commit); + stdin.write(&spv_operator_blockhash); let elf_id = if ELF_ID.get().is_none() { ELF_ID diff --git a/circuits/operator-proof/host/src/main.rs b/circuits/operator-proof/host/src/main.rs index 0640ba52..84e3d686 100644 --- a/circuits/operator-proof/host/src/main.rs +++ b/circuits/operator-proof/host/src/main.rs @@ -1,4 +1,5 @@ //! Generate operator proof +use bitcoin::constants::TARGET_BLOCK_SPACING; use clap::Parser; use operator_proof::{Args, OperatorProofBuilder, fetch_target_block_and_watchtower_tx}; use proof_builder::{ProofBuilder, ProofRequest}; @@ -12,17 +13,20 @@ async fn main() { zkm_sdk::utils::setup_logger(); let ( - block_pos, - target_block, + block_pos_ss_commit, + target_block_ss_commit, + block_pos_operator_blockhash, + target_block_operator_blockhash, operator_latest_sequencer_commit_txn, + operator_blockhash_commit_txn, watchtower_challenge_txns, watchtower_challenge_txn_prev_outs, - watchtower_challenge_txn_prev_indices, watchtower_challenge_txn_pubkeys, watchtower_challenge_txn_scripts, ) = fetch_target_block_and_watchtower_tx( &args.esplora_url, &args.latest_sequencer_commit_txid, + &args.operator_blockhash_commit_txid, &args.watchtower_challenge_init_txid, &args.watchtower_challenge_txids, &args.watchtower_public_keys, @@ -45,13 +49,15 @@ async fn main() { output: args.output.clone(), - block_pos, - target_block, + block_pos_ss_commit, + target_block_ss_commit, operator_latest_sequencer_commit_txn, + block_pos_operator_blockhash, + target_block_operator_blockhash, + operator_blockhash_commit_txn, watchtower_challenge_txns, watchtower_challenge_txn_prev_outs, - watchtower_challenge_txn_prev_indices, watchtower_challenge_txn_pubkeys, watchtower_challenge_txn_scripts, }; diff --git a/circuits/proof-builder/src/lib.rs b/circuits/proof-builder/src/lib.rs index 33312b3b..7dc2877d 100644 --- a/circuits/proof-builder/src/lib.rs +++ b/circuits/proof-builder/src/lib.rs @@ -1,7 +1,7 @@ use anyhow::Result; use bitcoin::{Block, ScriptBuf, Transaction, TxOut}; use commit_chain::CircuitCommit; -use header_chain::{CircuitBlockHeader, CircuitTransaction}; +use header_chain::CircuitBlockHeader; use serde::{Deserialize, Serialize}; use state_chain::CircuitStateBlock; use thiserror::Error; @@ -54,12 +54,17 @@ pub enum ProofRequest { state_chain_input_proof: String, execution_layer_block_number: u64, output: String, - target_block: Block, - block_pos: u32, + + target_block_ss_commit: Block, + block_pos_ss_commit: u32, operator_latest_sequencer_commit_txn: Transaction, - watchtower_challenge_txns: Vec, + + target_block_operator_blockhash: Block, + block_pos_operator_blockhash: u32, + operator_blockhash_commit_txn: Transaction, + + watchtower_challenge_txns: Vec, watchtower_challenge_txn_prev_outs: Vec, - watchtower_challenge_txn_prev_indices: Vec, watchtower_challenge_txn_pubkeys: Vec, watchtower_challenge_txn_scripts: Vec, }, @@ -113,4 +118,5 @@ pub struct OnDemandTask { pub included_watchtowers: Vec, pub watchtower_public_keys: Vec, pub graph_id: Option, + pub operator_blockhash_commit_txid: Option, } diff --git a/crates/bitcoin-light-client-circuit/src/lib.rs b/crates/bitcoin-light-client-circuit/src/lib.rs index ba3af96d..0b6cc5f2 100644 --- a/crates/bitcoin-light-client-circuit/src/lib.rs +++ b/crates/bitcoin-light-client-circuit/src/lib.rs @@ -141,17 +141,16 @@ pub fn propose_longest_chain( graph_id: [u8; GRAPH_ID_SIZE], // pis operator_genesis_sequencer_commit_txid: [u8; 32], // pis - operator_latest_sequencer_commit_txn: CircuitTransaction, - watchtower_challenge_txns: Vec, + watchtower_challenge_txns: Vec, watchtower_challenge_txn_pubkey: Vec, watchtower_challenge_txn_scripts: Vec, watchtower_challenge_txn_prev_outs: Vec, - watchtower_challenge_txn_prev_indices: Vec, operator_header_chain: HeaderChainCircuitInput, commit_chain: CommitChainCircuitInput, state_chain: StateChainCircuitInput, - spv: SPV, + spv_ss_commit: SPV, + spv_operator_blockhash: SPV, ) -> ([u8; 32], [u8; 32], [u8; 32]) { // verify operator_latest_sequencer_commit_txid is valid, and on operator head chain // * Check operator_latest_sequencer_commit_txid is derived from genesis_sequencer_commit_txid @@ -168,7 +167,7 @@ pub fn propose_longest_chain( }; assert_eq!( commit_chain_output.chain_state.commit_txn.compute_txid(), - operator_latest_sequencer_commit_txn.compute_txid() + spv_ss_commit.transaction.0.compute_txid() ); assert_eq!( operator_genesis_sequencer_commit_txid, @@ -194,7 +193,9 @@ pub fn propose_longest_chain( let btc_best_block_hash = btc_header_chain_output.chain_state.best_block_hash; // verify that the latest_sequecner_commit_tx is in the header chain - assert!(spv.verify(&btc_header_chain_output.chain_state.block_hashes_mmr)); + assert!(spv_ss_commit.verify(&btc_header_chain_output.chain_state.block_hashes_mmr)); + // verify that the operator_blockhash is in the header chain + assert!(spv_operator_blockhash.verify(&btc_header_chain_output.chain_state.block_hashes_mmr)); // parse included_watchtowers into bits array let included_watchertowers_bits = u256_to_le_bits(included_watchtowers); @@ -206,16 +207,16 @@ pub fn propose_longest_chain( for i in 0..watchtower_challenge_txns.len() { if included_watchertowers_bits[i] { let tx = &watchtower_challenge_txns[i]; - println!("Verify watchtower[{i}] tx: {}, {:?}", tx.0.compute_txid(), tx.0); + println!("Verify watchtower[{i}] tx: {}, {:?}", tx.compute_txid(), tx); let prev_out = &watchtower_challenge_txn_prev_outs[i]; - let prev_index = watchtower_challenge_txn_prev_indices[i]; + let prev_index = tx.input[0].previous_output.vout as usize; let pubkey = &watchtower_challenge_txn_pubkey[i]; let sig = bitcoin::taproot::Signature::from_slice(&tx.input[0].witness[0]).unwrap(); // check tx signature is valid match verify_taproot_leaf_schnorr_signature( &watchtower_challenge_txn_scripts[i], - &tx.0, + tx, prev_index, prev_out, pubkey, @@ -344,7 +345,8 @@ pub fn propose_longest_chain( //println!("operator public input hex: {:?}", hex::encode(operator_public_input)); //operator_public_input - (btc_best_block_hash, constant, included_watchtowers.to_le_bytes::<32>()) + let operator_blockhash = spv_operator_blockhash.transaction.0.compute_txid().to_byte_array(); + (operator_blockhash, constant, included_watchtowers.to_le_bytes::<32>()) } pub fn hash_operator_constant( @@ -379,12 +381,12 @@ pub fn words_from_bytes_be(bytes: &[u8; 32]) -> [u32; 8] { } pub fn build_spv( - latest_sequencer_commit_txn: &Transaction, + raw_txn: &Transaction, target_block_pos: u32, target_block: Block, block_headers: &[CircuitBlockHeader], ) -> SPV { - let tx: CircuitTransaction = CircuitTransaction(latest_sequencer_commit_txn.clone()); + let tx: CircuitTransaction = CircuitTransaction(raw_txn.clone()); let latest_sequencer_commit_txid = tx.0.compute_txid(); let mut mmr_native = MMRHost::new(); diff --git a/crates/store/.sqlx/query-9ef96b0495f30b61a26f5577ebea8b2f67b04e178a7bf340b120af3fd1d4dc64.json b/crates/store/.sqlx/query-7e50ecfde6444e82743d67ea9028d914b36a04991a5aa7ce1d5fe7fb4d3673b3.json similarity index 62% rename from crates/store/.sqlx/query-9ef96b0495f30b61a26f5577ebea8b2f67b04e178a7bf340b120af3fd1d4dc64.json rename to crates/store/.sqlx/query-7e50ecfde6444e82743d67ea9028d914b36a04991a5aa7ce1d5fe7fb4d3673b3.json index c9d85fb5..f70b36fd 100644 --- a/crates/store/.sqlx/query-9ef96b0495f30b61a26f5577ebea8b2f67b04e178a7bf340b120af3fd1d4dc64.json +++ b/crates/store/.sqlx/query-7e50ecfde6444e82743d67ea9028d914b36a04991a5aa7ce1d5fe7fb4d3673b3.json @@ -1,12 +1,12 @@ { "db_name": "SQLite", - "query": "INSERT\n INTO operator_proof (instance_id, graph_id, execution_layer_block_number, path_to_proof, public_value_hex, proof_size, cycles, proof_state, total_time_to_proof, proving_time,\n zkm_version, extra, updated_at, created_at)\n VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", + "query": "INSERT\n INTO operator_proof (instance_id, graph_id, execution_layer_block_number, path_to_proof, public_value_hex, proof_size, cycles, proof_state, total_time_to_proof, proving_time,\n zkm_version, extra, updated_at, created_at, blockhash_commit_txid)\n VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", "describe": { "columns": [], "parameters": { - "Right": 14 + "Right": 15 }, "nullable": [] }, - "hash": "9ef96b0495f30b61a26f5577ebea8b2f67b04e178a7bf340b120af3fd1d4dc64" + "hash": "7e50ecfde6444e82743d67ea9028d914b36a04991a5aa7ce1d5fe7fb4d3673b3" } diff --git a/crates/store/migrations/20260117031151_alter_operator_proof_table.sql b/crates/store/migrations/20260117031151_alter_operator_proof_table.sql new file mode 100644 index 00000000..057386d5 --- /dev/null +++ b/crates/store/migrations/20260117031151_alter_operator_proof_table.sql @@ -0,0 +1,3 @@ +-- Add migration script here +ALTER TABLE `operator_proof` + ADD COLUMN `blockhash_commit_txid` TEXT NOT NULL DEFAULT 'dac7516877b069dac6d2b0430e8b23812392665ecbb0c36c78c8acd12ddc929e'; \ No newline at end of file diff --git a/crates/store/src/localdb.rs b/crates/store/src/localdb.rs index 71c143bf..34dda93b 100644 --- a/crates/store/src/localdb.rs +++ b/crates/store/src/localdb.rs @@ -2584,8 +2584,8 @@ impl<'a> StorageProcessor<'a> { let res = sqlx::query!( "INSERT INTO operator_proof (instance_id, graph_id, execution_layer_block_number, path_to_proof, public_value_hex, proof_size, cycles, proof_state, total_time_to_proof, proving_time, - zkm_version, extra, updated_at, created_at) - VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", + zkm_version, extra, updated_at, created_at, blockhash_commit_txid) + VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", operator_proof.instance_id, operator_proof.graph_id, operator_proof.execution_layer_block_number, @@ -2600,6 +2600,7 @@ impl<'a> StorageProcessor<'a> { operator_proof.extra, operator_proof.updated_at, operator_proof.created_at, + operator_proof.blockhash_commit_txid, ) .execute(self.conn()) .await?; @@ -2698,22 +2699,7 @@ impl<'a> StorageProcessor<'a> { graph_id: &Uuid, ) -> anyhow::Result> { let res = sqlx::query_as::<_, OperatorProof>( - "SELECT id, - instance_id, - graph_id, - execution_layer_block_number, - path_to_proof, - public_value_hex, - proof_size, - cycles, - proof_state, - total_time_to_proof, - proving_time, - zkm_version, - extra, - created_at, - updated_at - FROM operator_proof + "SELECT * FROM operator_proof WHERE instance_id = ? AND graph_id = ?", ) @@ -2724,50 +2710,9 @@ impl<'a> StorageProcessor<'a> { Ok(res) } - pub async fn find_operator_proofs_unproved(&mut self) -> anyhow::Result> { - let res = sqlx::query_as::<_, OperatorProof>( - "SELECT id, - instance_id, - graph_id, - execution_layer_block_number, - path_to_proof, - public_value_hex, - proof_size, - cycles, - proof_state, - total_time_to_proof, - proving_time, - zkm_version, - extra, - created_at, - updated_at - FROM operator_proof - WHERE proof_state != 2 - ORDER BY id ASC", - ) - .fetch_all(self.conn()) - .await?; - Ok(res) - } - pub async fn find_next_operator_proof(&mut self) -> anyhow::Result> { let res = sqlx::query_as::<_, OperatorProof>( - "SELECT id, - instance_id, - graph_id, - execution_layer_block_number, - path_to_proof, - public_value_hex, - proof_size, - cycles, - proof_state, - total_time_to_proof, - proving_time, - zkm_version, - extra, - created_at, - updated_at - FROM operator_proof + "SELECT * FROM operator_proof WHERE proof_state == 0 ORDER BY id ASC LIMIT 1", diff --git a/crates/store/src/schema.rs b/crates/store/src/schema.rs index 9641097d..fcc0635b 100644 --- a/crates/store/src/schema.rs +++ b/crates/store/src/schema.rs @@ -719,6 +719,7 @@ pub struct OperatorProof { pub id: i64, pub instance_id: Uuid, pub graph_id: Uuid, + pub blockhash_commit_txid: SerializableTxid, pub execution_layer_block_number: i64, pub path_to_proof: Option, pub public_value_hex: Option, diff --git a/deployment/regtest/proof-builder-rpc/proof-builder.toml b/deployment/regtest/proof-builder-rpc/proof-builder.toml index 97e50d7b..aabee44c 100644 --- a/deployment/regtest/proof-builder-rpc/proof-builder.toml +++ b/deployment/regtest/proof-builder-rpc/proof-builder.toml @@ -59,6 +59,7 @@ enable = true esplora_url = "http://127.0.0.1:13002" genesis_sequencer_commit_txid = "5d5a29e1c426abc4b947f90b93c6b043683aafad79cb3b9a9829dfd5e51cad09" latest_sequencer_commit_txid = "dac7516877b069dac6d2b0430e8b23812392665ecbb0c36c78c8acd12ddc929e" +operator_blockhash_commit_txid = "dac7516877b069dac6d2b0430e8b23812392665ecbb0c36c78c8acd12ddc929e" watchtower_challenge_init_txid = "7f7b4344adb1b8937ddb7124e4f8bba80ee9adf5e8119de76ca8736816bda246" watchtower_challenge_txids = "3b155884a7f6dd65836045779c6cb5e0ebe11d4630f825fb45682b8cef1c79f0" watchtower_public_keys = "0272efe7ccae21d2541ad85d4f2961f2e5593c29dc8bc37bf87035fc2d5527a651" diff --git a/node/src/rpc_service/proof.rs b/node/src/rpc_service/proof.rs index e605fd82..519a0a09 100644 --- a/node/src/rpc_service/proof.rs +++ b/node/src/rpc_service/proof.rs @@ -53,6 +53,7 @@ pub struct ProofDescResponse { pub struct OperatorProofRequest { pub instance_id: String, pub graph_id: String, + pub blockhash_commit_txid: String, pub execution_layer_block_number: i64, pub watchtower_challenge_txids: Vec, pub included_watchtowers: Vec, diff --git a/node/src/utils.rs b/node/src/utils.rs index 10209c0e..213f09b4 100644 --- a/node/src/utils.rs +++ b/node/src/utils.rs @@ -1812,6 +1812,7 @@ pub async fn get_operator_proof( btc_client: &BTCClient, instance_id: Uuid, graph_id: Uuid, + blockhash_commit_txid: SerializableTxid, ) -> Result<(Option<(GuestInputs, Groth16Proof, PublicInputs, VerifyingKey)>, usize)> { let mut storage_processor = local_db.acquire().await?; if let Some(graph) = storage_processor.find_graph(&graph_id).await? { @@ -1850,6 +1851,7 @@ pub async fn get_operator_proof( &OperatorProofRequest { instance_id: instance_id.to_string(), graph_id: graph_id.to_string(), + blockhash_commit_txid: blockhash_commit_txid.0.to_string(), execution_layer_block_number: graph.proceed_withdraw_height, watchtower_challenge_txids, included_watchtowers, @@ -2793,6 +2795,24 @@ pub async fn operator_send_assert_commit( inputs } else { let wots_secret_keys = operator_master_key.wots_keypair_for_graph(graph_id).0; + let connector_g_vout = graph.parameters.watchtower_pubkeys.len() * 2; + let blockhash_commit_txid = match outpoint_spent_txid( + btc_client, + &graph.watchtower_challenge_init.tx().compute_txid(), + connector_g_vout as u64, + ) + .await + { + Ok(Some(txid)) => txid, + Ok(None) => { + bail!( + "challenge-init connector G not spent yet, cannot generate assert-commit proof" + ); + } + Err(e) => { + bail!("failed to check challenge-init connector G spent status: {e}"); + } + }; let (guest_inputs, proof, groth16_pubin, vk) = match get_operator_proof( local_db, http_client, @@ -2800,6 +2820,7 @@ pub async fn operator_send_assert_commit( btc_client, instance_id, graph_id, + blockhash_commit_txid.into(), ) .await? { diff --git a/proof-builder-rpc/proof-builder.toml.example b/proof-builder-rpc/proof-builder.toml.example index 9a8a40c9..6dff27cd 100644 --- a/proof-builder-rpc/proof-builder.toml.example +++ b/proof-builder-rpc/proof-builder.toml.example @@ -59,6 +59,7 @@ enable = true esplora_url = "http://127.0.0.1:13002" genesis_sequencer_commit_txid = "5d5a29e1c426abc4b947f90b93c6b043683aafad79cb3b9a9829dfd5e51cad09" latest_sequencer_commit_txid = "dac7516877b069dac6d2b0430e8b23812392665ecbb0c36c78c8acd12ddc929e" +operator_blockhash_commit_txid = "dac7516877b069dac6d2b0430e8b23812392665ecbb0c36c78c8acd12ddc929e" watchtower_challenge_init_txid = "8e6c8c54cde0404bd7c2928878cdcfb531da7bb8a9935cfb632c8183446cdaf9" watchtower_challenge_txids = "8d3495cc7a0b0627d4e7bc19215e14ea858c97e768b2ce63b2ce2de0d1088db9" watchtower_public_keys = "03e7a08db9093c279535bd0078582469b82bf9f12c6dcb7588e187d2b9cc724279" diff --git a/proof-builder-rpc/src/api/proof_handler.rs b/proof-builder-rpc/src/api/proof_handler.rs index 9cf1cc16..541915ad 100644 --- a/proof-builder-rpc/src/api/proof_handler.rs +++ b/proof-builder-rpc/src/api/proof_handler.rs @@ -169,6 +169,7 @@ pub(super) async fn post_operator_proof_task( &api_state.local_db, instance_id, graph_id, + payload.blockhash_commit_txid, payload.execution_layer_block_number, payload.watchtower_challenge_txids.clone(), payload.included_watchtowers.clone(), diff --git a/proof-builder-rpc/src/api/proofs.rs b/proof-builder-rpc/src/api/proofs.rs index fe4d2017..31d6bcde 100644 --- a/proof-builder-rpc/src/api/proofs.rs +++ b/proof-builder-rpc/src/api/proofs.rs @@ -67,6 +67,7 @@ pub(super) struct ProofDescResponse { pub(super) struct OperatorProofRequest { pub instance_id: String, pub graph_id: String, + pub blockhash_commit_txid: String, pub execution_layer_block_number: i64, pub watchtower_challenge_txids: Vec, pub included_watchtowers: Vec, diff --git a/proof-builder-rpc/src/task/mod.rs b/proof-builder-rpc/src/task/mod.rs index ca0a78d5..8f6fa3f4 100644 --- a/proof-builder-rpc/src/task/mod.rs +++ b/proof-builder-rpc/src/task/mod.rs @@ -213,6 +213,7 @@ async fn read_watchtower_challenge_details<'a>( Vec, Vec, Option, + Option, i64, )> { let ( @@ -223,6 +224,7 @@ async fn read_watchtower_challenge_details<'a>( included_watchtowers, watchtower_public_keys, graph_id, + operator_blockhash_commit_txid, ) = if is_watchtower { match storage_processor.find_next_watchtower_proof().await? { Some(task) => { @@ -237,6 +239,7 @@ async fn read_watchtower_challenge_details<'a>( vec![], pubkeys, Some(task.graph_id.as_simple().to_string()), + None, ) } None => { @@ -286,6 +289,7 @@ async fn read_watchtower_challenge_details<'a>( included_watchtowers, challenge_public_keys, Some(task.graph_id.as_simple().to_string()), + Some(task.blockhash_commit_txid.0.to_string()), ) }; @@ -335,6 +339,7 @@ async fn read_watchtower_challenge_details<'a>( included_watchtowers, watchtower_public_keys, graph_id, + operator_blockhash_commit_txid, btc_block_number, )) } @@ -386,6 +391,7 @@ pub(crate) async fn fetch_on_demand_task( included_watchtowers, watchtower_public_keys, graph_id, + operator_blockhash_commit_txid, btc_block_number, ) = match read_watchtower_challenge_details( &mut storage_processor, @@ -407,7 +413,7 @@ pub(crate) async fn fetch_on_demand_task( return Ok(None); } - // If we finish the sequencer set commitment shortly, the latest commit txid is confirmed after `btc_block_number`, and leads to the latest_commit_txid not included in header chain proof. + // If we finish the sequencer set commitment shortly, the latest commit txid is confirmed after `btc_block_number`, which leads to the latest_commit_txid not included in header chain proof. let header_chain_input_proof = match storage_processor .find_latest_long_running_task_proof_by_name(HeaderChainProofBuilder::name()) .await? @@ -459,6 +465,7 @@ pub(crate) async fn fetch_on_demand_task( included_watchtowers, watchtower_public_keys, graph_id, + operator_blockhash_commit_txid, })) } @@ -640,6 +647,7 @@ pub(crate) async fn add_operator_task( local_db: &LocalDB, instance_id: Uuid, graph_id: Uuid, + blockhash_commit_txid: String, execution_layer_block_number: i64, watchtower_challenge_txids: Vec, included_watchtowers: Vec, @@ -710,6 +718,7 @@ pub(crate) async fn add_operator_task( created_at: current_time_secs(), updated_at: current_time_secs(), cycles: 0, + blockhash_commit_txid: Txid::from_str(&blockhash_commit_txid)?.into(), ..Default::default() }) .await?; @@ -826,11 +835,15 @@ mod tests { "4506cf35cd70b3006fe3ce4a87ca1f9b0a76f348cfb529423e2d4c163c28d604".to_string(), "f16286f143430a229c6d068798cd9ba751e83202de5045cc788aab227114cdb2".to_string(), ]; + let blockhash_commit_txid = + "7f7b4344adb1b8937ddb7124e4f8bba80ee9adf5e8119de76ca8736816bda246".to_string(); + let included_watchtowers = vec![true, false]; add_operator_task( &local_db, instance_id, graph_id, + blockhash_commit_txid, number, watchtower_challenge_txids, included_watchtowers, diff --git a/proof-builder-rpc/src/task/operator_proof.rs b/proof-builder-rpc/src/task/operator_proof.rs index acdf143e..11fa779f 100644 --- a/proof-builder-rpc/src/task/operator_proof.rs +++ b/proof-builder-rpc/src/task/operator_proof.rs @@ -42,6 +42,7 @@ pub(crate) fn spawn_operator_proof_task( args.header_chain_input_proof = next_task.header_chain_input_proof; args.commit_chain_input_proof = next_task.commit_chain_input_proof; args.state_chain_input_proof = next_task.state_chain_input_proof; + args.operator_blockhash_commit_txid = next_task.operator_blockhash_commit_txid.unwrap(); args.graph_id = next_task.graph_id.unwrap(); args.output = format!("{}/{}.bin", std::path::Path::new(&args.output).parent().unwrap().to_str().unwrap(), @@ -54,24 +55,26 @@ pub(crate) fn spawn_operator_proof_task( args.included_watchtowers = le_bits_to_u256(&next_task.included_watchtowers).to_string(); task_index = next_task.task_index; } else { - tracing::info!("Wait for the next task"); tokio::time::sleep(Duration::from_secs(5)).await; continue; }; info!("Operator proof generate task: generate proof, args: {args:?}"); let ( - block_pos, - target_block, + block_pos_ss_commit, + target_block_ss_commit, + block_pos_operator_blockhash, + target_block_operator_blockhash, operator_latest_sequencer_commit_txn, + operator_blockhash_commit_txn, watchtower_challenge_txns, watchtower_challenge_txn_prev_outs, - watchtower_challenge_txn_prev_indices, watchtower_challenge_txn_pubkeys, watchtower_challenge_txn_scripts, ) = match fetch_target_block_and_watchtower_tx( &args.esplora_url, &args.latest_sequencer_commit_txid, + &args.operator_blockhash_commit_txid, &args.watchtower_challenge_init_txid, &args.watchtower_challenge_txids, &args.watchtower_public_keys, @@ -97,13 +100,16 @@ pub(crate) fn spawn_operator_proof_task( output: args.output.clone(), - block_pos, - target_block, + block_pos_ss_commit, + target_block_ss_commit, operator_latest_sequencer_commit_txn, + block_pos_operator_blockhash, + target_block_operator_blockhash, + operator_blockhash_commit_txn, + watchtower_challenge_txns, watchtower_challenge_txn_prev_outs, - watchtower_challenge_txn_prev_indices, watchtower_challenge_txn_pubkeys, watchtower_challenge_txn_scripts, }; diff --git a/proof-builder-rpc/src/task/watchtower_proof.rs b/proof-builder-rpc/src/task/watchtower_proof.rs index c6512899..06990839 100644 --- a/proof-builder-rpc/src/task/watchtower_proof.rs +++ b/proof-builder-rpc/src/task/watchtower_proof.rs @@ -47,7 +47,6 @@ pub(crate) fn spawn_watchtower_proof_task( ); task_index = next_task.task_index; } else { - tracing::info!("Wait for the next task"); tokio::time::sleep(Duration::from_secs(5)).await; continue; };