From 950da38e11d455a7f12ecf3d72a450559e0e5e4a Mon Sep 17 00:00:00 2001 From: Sasha Syrotenko Date: Wed, 30 Oct 2024 13:54:29 +0200 Subject: [PATCH] LayerZero: Executor (#305) This patch adds `Executor` role to `NFFL` as well as an integration test for it --- Cargo.lock | 759 +++++++++++++++++++++++++++++- Cargo.toml | 2 +- workers/Cargo.toml | 8 + workers/abi/L0V2Endpoint.json | 2 +- workers/abi/ReceiveLibUln302.json | 1 - workers/src/bin/executor.rs | 25 + workers/src/chain/connections.rs | 40 +- workers/src/chain/contracts.rs | 49 ++ workers/src/config.rs | 16 +- workers/src/executor_def.rs | 166 +++++++ workers/src/lib.rs | 1 + workers/tests/executor_it.rs | 112 +++++ 12 files changed, 1149 insertions(+), 32 deletions(-) delete mode 100644 workers/abi/ReceiveLibUln302.json create mode 100644 workers/src/bin/executor.rs create mode 100644 workers/src/executor_def.rs create mode 100644 workers/tests/executor_it.rs diff --git a/Cargo.lock b/Cargo.lock index 5071d45c..3c5f370e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -367,6 +367,9 @@ dependencies = [ "alloy-rpc-types", "alloy-serde", "alloy-signer", + "alloy-signer-aws", + "alloy-signer-gcp", + "alloy-signer-ledger", "alloy-signer-local", "alloy-transport", "alloy-transport-http", @@ -446,6 +449,7 @@ dependencies = [ "alloy-sol-type-parser", "alloy-sol-types", "const-hex", + "derive_more 1.0.0", "itoa", "serde", "serde_json", @@ -640,7 +644,7 @@ dependencies = [ "futures", "futures-utils-wasm", "lru 0.12.5", - "pin-project", + "pin-project 1.1.6", "reqwest 0.12.8", "serde", "serde_json", @@ -705,7 +709,7 @@ dependencies = [ "alloy-transport-ipc", "alloy-transport-ws", "futures", - "pin-project", + "pin-project 1.1.6", "reqwest 0.12.8", "serde", "serde_json", @@ -805,7 +809,9 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fd4e0ad79c81a27ca659be5d176ca12399141659fef2bcbfdc848da478f4504" dependencies = [ + "alloy-dyn-abi", "alloy-primitives", + "alloy-sol-types", "async-trait", "auto_impl", "elliptic-curve", @@ -813,6 +819,62 @@ dependencies = [ "thiserror", ] +[[package]] +name = "alloy-signer-aws" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "417e19d9844350d11f7426d4920a5df777f8c2abbb7a70d9de6f1faf284db15b" +dependencies = [ + "alloy-consensus", + "alloy-network", + "alloy-primitives", + "alloy-signer", + "async-trait", + "aws-sdk-kms", + "k256", + "spki", + "thiserror", + "tracing", +] + +[[package]] +name = "alloy-signer-gcp" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fd12ae28e8330766821058ed9a6a06ae4f9b12c776e8a7cfb16e3a954f508e" +dependencies = [ + "alloy-consensus", + "alloy-network", + "alloy-primitives", + "alloy-signer", + "async-trait", + "gcloud-sdk", + "k256", + "spki", + "thiserror", + "tracing", +] + +[[package]] +name = "alloy-signer-ledger" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3a02400dea370022151f07581b73a836115c88ce4df350206653493bec024e2" +dependencies = [ + "alloy-consensus", + "alloy-dyn-abi", + "alloy-network", + "alloy-primitives", + "alloy-signer", + "alloy-sol-types", + "async-trait", + "coins-ledger", + "futures-util", + "semver 1.0.23", + "thiserror", + "tracing", +] + [[package]] name = "alloy-signer-local" version = "0.4.2" @@ -948,7 +1010,7 @@ dependencies = [ "bytes", "futures", "interprocess", - "pin-project", + "pin-project 1.1.6", "serde_json", "tokio", "tokio-util", @@ -1315,6 +1377,19 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "async-compression" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" +dependencies = [ + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + [[package]] name = "async-executor" version = "1.13.1" @@ -1548,6 +1623,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "aws-credential-types" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60e8f6b615cb5fc60a98132268508ad104310f0cfb25a1c22eee76efdf9154da" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "zeroize", +] + [[package]] name = "aws-creds" version = "0.30.0" @@ -1573,6 +1660,193 @@ dependencies = [ "thiserror", ] +[[package]] +name = "aws-runtime" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a10d5c055aa540164d9561a0e2e74ad30f0dcf7393c3a92f6733ddf9c5762468" +dependencies = [ + "aws-credential-types", + "aws-sigv4", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "fastrand 2.1.1", + "http 0.2.12", + "http-body 0.4.6", + "once_cell", + "percent-encoding", + "pin-project-lite", + "tracing", + "uuid", +] + +[[package]] +name = "aws-sdk-kms" +version = "1.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "564a597a3c71a957d60a2e4c62c93d78ee5a0d636531e15b760acad983a5c18e" +dependencies = [ + "aws-credential-types", + "aws-runtime", + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-json", + "aws-smithy-runtime", + "aws-smithy-runtime-api", + "aws-smithy-types", + "aws-types", + "bytes", + "http 0.2.12", + "once_cell", + "regex-lite", + "tracing", +] + +[[package]] +name = "aws-sigv4" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc8db6904450bafe7473c6ca9123f88cc11089e41a025408f992db4e22d3be68" +dependencies = [ + "aws-credential-types", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "form_urlencoded", + "hex", + "hmac", + "http 0.2.12", + "http 1.1.0", + "once_cell", + "percent-encoding", + "sha2", + "time", + "tracing", +] + +[[package]] +name = "aws-smithy-async" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62220bc6e97f946ddd51b5f1361f78996e704677afc518a4ff66b7a72ea1378c" +dependencies = [ + "futures-util", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "aws-smithy-http" +version = "0.60.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8bc3e8fdc6b8d07d976e301c02fe553f72a39b7a9fea820e023268467d7ab6" +dependencies = [ + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "bytes-utils", + "futures-core", + "http 0.2.12", + "http-body 0.4.6", + "once_cell", + "percent-encoding", + "pin-project-lite", + "pin-utils", + "tracing", +] + +[[package]] +name = "aws-smithy-json" +version = "0.60.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" +dependencies = [ + "aws-smithy-types", +] + +[[package]] +name = "aws-smithy-runtime" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a065c0fe6fdbdf9f11817eb68582b2ab4aff9e9c39e986ae48f7ec576c6322db" +dependencies = [ + "aws-smithy-async", + "aws-smithy-http", + "aws-smithy-runtime-api", + "aws-smithy-types", + "bytes", + "fastrand 2.1.1", + "http 0.2.12", + "http-body 0.4.6", + "http-body 1.0.1", + "httparse", + "once_cell", + "pin-project-lite", + "pin-utils", + "tokio", + "tracing", +] + +[[package]] +name = "aws-smithy-runtime-api" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e086682a53d3aa241192aa110fa8dfce98f2f5ac2ead0de84d41582c7e8fdb96" +dependencies = [ + "aws-smithy-async", + "aws-smithy-types", + "bytes", + "http 0.2.12", + "http 1.1.0", + "pin-project-lite", + "tokio", + "tracing", + "zeroize", +] + +[[package]] +name = "aws-smithy-types" +version = "1.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147100a7bea70fa20ef224a6bad700358305f5dc0f84649c53769761395b355b" +dependencies = [ + "base64-simd", + "bytes", + "bytes-utils", + "http 0.2.12", + "http 1.1.0", + "http-body 0.4.6", + "http-body 1.0.1", + "http-body-util", + "itoa", + "num-integer", + "pin-project-lite", + "pin-utils", + "ryu", + "serde", + "time", +] + +[[package]] +name = "aws-types" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5221b91b3e441e6675310829fd8984801b772cb1546ef6c0e54dec9f1ac13fef" +dependencies = [ + "aws-credential-types", + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "rustc_version 0.4.1", + "tracing", +] + [[package]] name = "axum" version = "0.6.20" @@ -1580,7 +1854,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", - "axum-core", + "axum-core 0.3.4", "bitflags 1.3.2", "bytes", "futures-util", @@ -1601,6 +1875,40 @@ dependencies = [ "tower-service", ] +[[package]] +name = "axum" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" +dependencies = [ + "async-trait", + "axum-core 0.4.5", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "tokio", + "tower 0.5.1", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "axum-core" version = "0.3.4" @@ -1618,6 +1926,27 @@ dependencies = [ "tower-service", ] +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.1", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "backtrace" version = "0.3.74" @@ -1663,6 +1992,16 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64-simd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339abbe78e73178762e23bea9dfd08e697eb3f3301cd4be981c0f78ba5859195" +dependencies = [ + "outref", + "vsimd", +] + [[package]] name = "base64ct" version = "1.6.0" @@ -2034,6 +2373,16 @@ dependencies = [ "serde", ] +[[package]] +name = "bytes-utils" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" +dependencies = [ + "bytes", + "either", +] + [[package]] name = "bytesize" version = "1.3.0" @@ -2214,7 +2563,7 @@ dependencies = [ "dotenv", "futures-util", "hex", - "jsonwebtoken", + "jsonwebtoken 7.2.0", "lazy_static", "openssl", "percent-encoding", @@ -2245,6 +2594,29 @@ dependencies = [ "x509-cert", ] +[[package]] +name = "coins-ledger" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab9bc0994d0aa0f4ade5f3a9baf4a8d936f250278c85a1124b401860454246ab" +dependencies = [ + "async-trait", + "byteorder", + "cfg-if 1.0.0", + "const-hex", + "getrandom", + "hidapi-rusb", + "js-sys", + "log", + "nix 0.26.4", + "once_cell", + "thiserror", + "tokio", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", +] + [[package]] name = "colorchoice" version = "1.0.2" @@ -3107,6 +3479,7 @@ dependencies = [ "generic-array 0.14.7", "group", "hkdf", + "pem-rfc7468", "pkcs8", "rand_core", "sec1", @@ -3553,6 +3926,34 @@ dependencies = [ "serde_json", ] +[[package]] +name = "gcloud-sdk" +version = "0.25.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a1130d4e37435a63bd9d968a33c11b64bf35a2013779a353e29cd3598989d39" +dependencies = [ + "async-trait", + "bytes", + "chrono", + "futures", + "hyper 1.4.1", + "jsonwebtoken 9.3.0", + "once_cell", + "prost 0.13.3", + "prost-types", + "reqwest 0.12.8", + "secret-vault-value", + "serde", + "serde_json", + "tokio", + "tonic 0.12.3", + "tower 0.5.1", + "tower-layer", + "tower-util", + "tracing", + "url", +] + [[package]] name = "generic-array" version = "0.12.4" @@ -3589,8 +3990,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if 1.0.0", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -3754,6 +4157,18 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" +[[package]] +name = "hidapi-rusb" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efdc2ec354929a6e8f3c6b6923a4d97427ec2f764cfee8cd4bfe890946cdf08b" +dependencies = [ + "cc", + "libc", + "pkg-config", + "rusb", +] + [[package]] name = "hkdf" version = "0.12.4" @@ -3905,6 +4320,7 @@ dependencies = [ "hyper 1.4.1", "hyper-util", "rustls", + "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", "tokio-rustls", @@ -3923,6 +4339,19 @@ dependencies = [ "tokio-io-timeout", ] +[[package]] +name = "hyper-timeout" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" +dependencies = [ + "hyper 1.4.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -4254,11 +4683,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afabcc15e437a6484fc4f12d0fd63068fe457bf93f1c148d3d9649c60b103f32" dependencies = [ "base64 0.12.3", - "pem", + "pem 0.8.3", "ring 0.16.20", "serde", "serde_json", - "simple_asn1", + "simple_asn1 0.4.1", +] + +[[package]] +name = "jsonwebtoken" +version = "9.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +dependencies = [ + "base64 0.21.7", + "js-sys", + "pem 3.0.4", + "ring 0.17.8", + "serde", + "serde_json", + "simple_asn1 0.6.2", ] [[package]] @@ -4391,6 +4835,18 @@ dependencies = [ "zstd-sys", ] +[[package]] +name = "libusb1-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da050ade7ac4ff1ba5379af847a10a10a8e284181e060105bf8d86960ce9ce0f" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "libz-sys" version = "1.1.20" @@ -4604,6 +5060,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +dependencies = [ + "autocfg", +] + [[package]] name = "memoffset" version = "0.8.0" @@ -5196,7 +5661,7 @@ dependencies = [ "near-store", "opentelemetry", "parking_lot 0.12.3", - "pin-project", + "pin-project 1.1.6", "protobuf 3.6.0", "protobuf-codegen", "rand", @@ -5729,6 +6194,19 @@ dependencies = [ "memoffset 0.6.5", ] +[[package]] +name = "nix" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +dependencies = [ + "bitflags 1.3.2", + "cfg-if 1.0.0", + "libc", + "memoffset 0.7.1", + "pin-utils", +] + [[package]] name = "node-runtime" version = "2.3.0-rc.1" @@ -6006,10 +6484,10 @@ dependencies = [ "opentelemetry-proto", "opentelemetry-semantic-conventions", "opentelemetry_sdk", - "prost", + "prost 0.12.6", "thiserror", "tokio", - "tonic", + "tonic 0.11.0", ] [[package]] @@ -6020,8 +6498,8 @@ checksum = "3a8fddc9b68f5b80dae9d6f510b88e02396f006ad48cac349411fbecc80caae4" dependencies = [ "opentelemetry", "opentelemetry_sdk", - "prost", - "tonic", + "prost 0.12.6", + "tonic 0.11.0", ] [[package]] @@ -6084,6 +6562,12 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "outref" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" + [[package]] name = "overload" version = "0.1.1" @@ -6359,6 +6843,16 @@ dependencies = [ "regex", ] +[[package]] +name = "pem" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +dependencies = [ + "base64 0.22.1", + "serde", +] + [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -6429,13 +6923,33 @@ dependencies = [ "rustc_version 0.4.1", ] +[[package]] +name = "pin-project" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef0f924a5ee7ea9cbcea77529dba45f8a9ba9f622419fe3386ca581a3ae9d5a" +dependencies = [ + "pin-project-internal 0.4.30", +] + [[package]] name = "pin-project" version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ - "pin-project-internal", + "pin-project-internal 1.1.6", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "851c8d0ce9bebe43790dedfc86614c23494ac9f423dd618d3a61fc693eafe61e" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -6728,7 +7242,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.12.6", +] + +[[package]] +name = "prost" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" +dependencies = [ + "bytes", + "prost-derive 0.13.3", ] [[package]] @@ -6744,6 +7268,28 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "prost-derive" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" +dependencies = [ + "anyhow", + "itertools 0.13.0", + "proc-macro2", + "quote", + "syn 2.0.79", +] + +[[package]] +name = "prost-types" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" +dependencies = [ + "prost 0.13.3", +] + [[package]] name = "protobuf" version = "2.28.0" @@ -6847,6 +7393,54 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quinn" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.0.0", + "rustls", + "socket2 0.5.7", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +dependencies = [ + "bytes", + "rand", + "ring 0.17.8", + "rustc-hash 2.0.0", + "rustls", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +dependencies = [ + "libc", + "once_cell", + "socket2 0.5.7", + "tracing", + "windows-sys 0.59.0", +] + [[package]] name = "quote" version = "1.0.37" @@ -7147,6 +7741,7 @@ version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ + "async-compression", "base64 0.22.1", "bytes", "encoding_rs", @@ -7164,11 +7759,16 @@ dependencies = [ "js-sys", "log", "mime", + "mime_guess", "native-tls", "once_cell", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", + "rustls-native-certs 0.8.0", "rustls-pemfile 2.2.0", + "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", @@ -7176,10 +7776,13 @@ dependencies = [ "system-configuration 0.6.1", "tokio", "tokio-native-tls", + "tokio-rustls", + "tokio-util", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "windows-registry", ] @@ -7333,6 +7936,16 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +[[package]] +name = "rusb" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab9f9ff05b63a786553a4c02943b74b34a988448671001e9a27e2f0565cc05a4" +dependencies = [ + "libc", + "libusb1-sys", +] + [[package]] name = "rust-ini" version = "0.18.0" @@ -7478,6 +8091,7 @@ version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ + "log", "once_cell", "ring 0.17.8", "rustls-pki-types", @@ -7494,7 +8108,7 @@ checksum = "2a980454b497c439c274f2feae2523ed8138bbd3d323684e1435fec62f800481" dependencies = [ "log", "rustls", - "rustls-native-certs", + "rustls-native-certs 0.7.3", "rustls-pki-types", "rustls-webpki", ] @@ -7512,6 +8126,19 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.2.0", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -7662,6 +8289,19 @@ dependencies = [ "cc", ] +[[package]] +name = "secret-vault-value" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc32a777b53b3433b974c9c26b6d502a50037f8da94e46cb8ce2ced2cfdfaea0" +dependencies = [ + "prost 0.13.3", + "prost-types", + "serde", + "serde_json", + "zeroize", +] + [[package]] name = "security-framework" version = "2.11.1" @@ -7811,6 +8451,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_repr" version = "0.1.19" @@ -7979,6 +8629,18 @@ dependencies = [ "num-traits", ] +[[package]] +name = "simple_asn1" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +dependencies = [ + "num-bigint 0.4.6", + "num-traits", + "thiserror", + "time", +] + [[package]] name = "sized-chunks" version = "0.6.5" @@ -8654,18 +9316,51 @@ checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" dependencies = [ "async-stream", "async-trait", - "axum", + "axum 0.6.20", "base64 0.21.7", "bytes", "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.30", - "hyper-timeout", + "hyper-timeout 0.4.1", + "percent-encoding", + "pin-project 1.1.6", + "prost 0.12.6", + "tokio", + "tokio-stream", + "tower 0.4.13", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +dependencies = [ + "async-stream", + "async-trait", + "axum 0.7.7", + "base64 0.22.1", + "bytes", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-timeout 0.5.1", + "hyper-util", "percent-encoding", - "pin-project", - "prost", + "pin-project 1.1.6", + "prost 0.13.3", + "rustls-native-certs 0.8.0", + "rustls-pemfile 2.2.0", + "socket2 0.5.7", "tokio", + "tokio-rustls", "tokio-stream", "tower 0.4.13", "tower-layer", @@ -8682,7 +9377,7 @@ dependencies = [ "futures-core", "futures-util", "indexmap 1.9.3", - "pin-project", + "pin-project 1.1.6", "pin-project-lite", "rand", "slab", @@ -8703,8 +9398,10 @@ dependencies = [ "futures-util", "pin-project-lite", "sync_wrapper 0.1.2", + "tokio", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -8719,6 +9416,18 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" +[[package]] +name = "tower-util" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1093c19826d33807c72511e68f73b4a0469a3f22c2bd5f7d5212178b4b89674" +dependencies = [ + "futures-core", + "futures-util", + "pin-project 0.4.30", + "tower-service", +] + [[package]] name = "tracing" version = "0.1.40" @@ -9001,6 +9710,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + [[package]] name = "vsss-rs" version = "4.3.8" @@ -9901,15 +10616,19 @@ name = "workers" version = "0.1.0" dependencies = [ "alloy", + "axum 0.7.7", "blsful", "bytes", "config", "eyre", "futures", + "http-body-util", + "log", "reqwest 0.12.8", "serde", "serde_json", "tokio", + "tokio-tungstenite", "tracing", "tracing-subscriber", "wiremock", diff --git a/Cargo.toml b/Cargo.toml index eaba25f1..37c03770 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ edition = "2021" repository = "https://github.com/NethermindEth/near-sffl" [workspace.dependencies] -alloy = { version = "0.4.2", features = ["full", "node-bindings", "rpc-types-debug", "rpc-types-trace", "json-rpc", "rpc-client", "serde", "json-abi"] } +alloy = { version = "0.4.2", features = ["full", "node-bindings", "rpc-types-debug", "rpc-types-trace", "json-rpc", "rpc-client", "serde", "json-abi", "eip712"] } alloy-primitives = "0.8.3" alloy-rlp = "0.3.8" alloy-rpc-client = "0.4.2" diff --git a/workers/Cargo.toml b/workers/Cargo.toml index 9f021ae9..68476256 100644 --- a/workers/Cargo.toml +++ b/workers/Cargo.toml @@ -7,6 +7,10 @@ edition = "2021" name = "dvn" path = "src/bin/dvn.rs" +[[bin]] +name = "executor" +path = "src/bin/executor.rs" + [dependencies] alloy.workspace = true blsful = "2.5.7" @@ -20,6 +24,10 @@ serde_json.workspace = true tokio.workspace = true tracing.workspace = true tracing-subscriber = {workspace = true, features = ["env-filter"] } +tokio-tungstenite = "0.24.0" +log = "0.4.22" [dev-dependencies] +axum = "0.7.7" +http-body-util = "0.1.0" wiremock = "0.6.2" diff --git a/workers/abi/L0V2Endpoint.json b/workers/abi/L0V2Endpoint.json index 33f4ede9..f3d83171 100644 --- a/workers/abi/L0V2Endpoint.json +++ b/workers/abi/L0V2Endpoint.json @@ -1 +1 @@ -{"abi":[{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"LZ_AlreadyRegistered","type":"error"},{"inputs":[],"name":"LZ_ComposeExists","type":"error"},{"inputs":[{"internalType":"bytes32","name":"expected","type":"bytes32"},{"internalType":"bytes32","name":"actual","type":"bytes32"}],"name":"LZ_ComposeNotFound","type":"error"},{"inputs":[],"name":"LZ_DefaultReceiveLibUnavailable","type":"error"},{"inputs":[],"name":"LZ_DefaultSendLibUnavailable","type":"error"},{"inputs":[{"internalType":"uint256","name":"requiredNative","type":"uint256"},{"internalType":"uint256","name":"suppliedNative","type":"uint256"},{"internalType":"uint256","name":"requiredLzToken","type":"uint256"},{"internalType":"uint256","name":"suppliedLzToken","type":"uint256"}],"name":"LZ_InsufficientFee","type":"error"},{"inputs":[],"name":"LZ_InvalidExpiry","type":"error"},{"inputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"name":"LZ_InvalidNonce","type":"error"},{"inputs":[],"name":"LZ_InvalidPayloadHash","type":"error"},{"inputs":[],"name":"LZ_InvalidReceiveLibrary","type":"error"},{"inputs":[],"name":"LZ_LzTokenUnavailable","type":"error"},{"inputs":[],"name":"LZ_OnlyNonDefaultLib","type":"error"},{"inputs":[],"name":"LZ_OnlyReceiveLib","type":"error"},{"inputs":[],"name":"LZ_OnlyRegisteredLib","type":"error"},{"inputs":[],"name":"LZ_OnlyRegisteredOrDefaultLib","type":"error"},{"inputs":[],"name":"LZ_OnlySendLib","type":"error"},{"inputs":[],"name":"LZ_PathNotInitializable","type":"error"},{"inputs":[],"name":"LZ_PathNotVerifiable","type":"error"},{"inputs":[{"internalType":"bytes32","name":"expected","type":"bytes32"},{"internalType":"bytes32","name":"actual","type":"bytes32"}],"name":"LZ_PayloadHashNotFound","type":"error"},{"inputs":[],"name":"LZ_SameValue","type":"error"},{"inputs":[],"name":"LZ_SendReentrancy","type":"error"},{"inputs":[],"name":"LZ_Unauthorized","type":"error"},{"inputs":[],"name":"LZ_UnsupportedEid","type":"error"},{"inputs":[],"name":"LZ_UnsupportedInterface","type":"error"},{"inputs":[],"name":"LZ_ZeroLzTokenFee","type":"error"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Transfer_NativeFailed","type":"error"},{"inputs":[],"name":"Transfer_ToAddressIsZero","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint16","name":"index","type":"uint16"}],"name":"ComposeDelivered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint16","name":"index","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"}],"name":"ComposeSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"newLib","type":"address"}],"name":"DefaultReceiveLibrarySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"oldLib","type":"address"},{"indexed":false,"internalType":"uint256","name":"expiry","type":"uint256"}],"name":"DefaultReceiveLibraryTimeoutSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"newLib","type":"address"}],"name":"DefaultSendLibrarySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"delegate","type":"address"}],"name":"DelegateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"srcEid","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"sender","type":"bytes32"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"}],"name":"InboundNonceSkipped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newLib","type":"address"}],"name":"LibraryRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"indexed":false,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint16","name":"index","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"gas","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"extraData","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"reason","type":"bytes"}],"name":"LzComposeAlert","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"indexed":false,"internalType":"struct Origin","name":"origin","type":"tuple"},{"indexed":false,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"gas","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"extraData","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"reason","type":"bytes"}],"name":"LzReceiveAlert","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"LzTokenSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"srcEid","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"sender","type":"bytes32"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"name":"PacketBurnt","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"indexed":false,"internalType":"struct Origin","name":"origin","type":"tuple"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"PacketDelivered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"srcEid","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"sender","type":"bytes32"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"name":"PacketNilified","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"encodedPayload","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"options","type":"bytes"},{"indexed":false,"internalType":"address","name":"sendLibrary","type":"address"}],"name":"PacketSent","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"indexed":false,"internalType":"struct Origin","name":"origin","type":"tuple"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"name":"PacketVerified","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"newLib","type":"address"}],"name":"ReceiveLibrarySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"oldLib","type":"address"},{"indexed":false,"internalType":"uint256","name":"timeout","type":"uint256"}],"name":"ReceiveLibraryTimeoutSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"newLib","type":"address"}],"name":"SendLibrarySet","type":"event"},{"inputs":[],"name":"EMPTY_PAYLOAD_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NIL_PAYLOAD_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockedLibrary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"},{"internalType":"bytes32","name":"_sender","type":"bytes32"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"}],"name":"clear","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint16","name":"index","type":"uint16"}],"name":"composeQueue","outputs":[{"internalType":"bytes32","name":"messageHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"srcEid","type":"uint32"}],"name":"defaultReceiveLibrary","outputs":[{"internalType":"address","name":"lib","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"srcEid","type":"uint32"}],"name":"defaultReceiveLibraryTimeout","outputs":[{"internalType":"address","name":"lib","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"dstEid","type":"uint32"}],"name":"defaultSendLibrary","outputs":[{"internalType":"address","name":"lib","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oapp","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"delegate","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eid","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"address","name":"_lib","type":"address"},{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"uint32","name":"_configType","type":"uint32"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"config","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"}],"name":"getReceiveLibrary","outputs":[{"internalType":"address","name":"lib","type":"address"},{"internalType":"bool","name":"isDefault","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRegisteredLibraries","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSendContext","outputs":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint32","name":"_dstEid","type":"uint32"}],"name":"getSendLibrary","outputs":[{"internalType":"address","name":"lib","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"},{"internalType":"bytes32","name":"_sender","type":"bytes32"}],"name":"inboundNonce","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"inboundNonce","type":"uint64"}],"name":"inboundPayloadHash","outputs":[{"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"initializable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint32","name":"_dstEid","type":"uint32"}],"name":"isDefaultSendLibrary","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"lib","type":"address"}],"name":"isRegisteredLibrary","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSendingMessage","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"}],"name":"isSupportedEid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"},{"internalType":"address","name":"_actualReceiveLib","type":"address"}],"name":"isValidReceiveLibrary","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"}],"name":"lazyInboundNonce","outputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"uint16","name":"_index","type":"uint16"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzCompose","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"uint16","name":"_index","type":"uint16"},{"internalType":"uint256","name":"_gas","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"bytes","name":"_extraData","type":"bytes"},{"internalType":"bytes","name":"_reason","type":"bytes"}],"name":"lzComposeAlert","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"uint256","name":"_gas","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"bytes","name":"_extraData","type":"bytes"},{"internalType":"bytes","name":"_reason","type":"bytes"}],"name":"lzReceiveAlert","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lzToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nativeToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint32","name":"_dstEid","type":"uint32"},{"internalType":"bytes32","name":"_receiver","type":"bytes32"}],"name":"nextGuid","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"},{"internalType":"bytes32","name":"_sender","type":"bytes32"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"nilify","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"receiver","type":"bytes32"}],"name":"outboundNonce","outputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"receiver","type":"bytes32"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"bytes","name":"options","type":"bytes"},{"internalType":"bool","name":"payInLzToken","type":"bool"}],"internalType":"struct MessagingParams","name":"_params","type":"tuple"},{"internalType":"address","name":"_sender","type":"address"}],"name":"quote","outputs":[{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint32","name":"srcEid","type":"uint32"}],"name":"receiveLibraryTimeout","outputs":[{"internalType":"address","name":"lib","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lib","type":"address"}],"name":"registerLibrary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"receiver","type":"bytes32"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"bytes","name":"options","type":"bytes"},{"internalType":"bool","name":"payInLzToken","type":"bool"}],"internalType":"struct MessagingParams","name":"_params","type":"tuple"},{"internalType":"address","name":"_refundAddress","type":"address"}],"name":"send","outputs":[{"components":[{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"fee","type":"tuple"}],"internalType":"struct MessagingReceipt","name":"","type":"tuple"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"uint16","name":"_index","type":"uint16"},{"internalType":"bytes","name":"_message","type":"bytes"}],"name":"sendCompose","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"address","name":"_lib","type":"address"},{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint32","name":"configType","type":"uint32"},{"internalType":"bytes","name":"config","type":"bytes"}],"internalType":"struct SetConfigParam[]","name":"_params","type":"tuple[]"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_newLib","type":"address"},{"internalType":"uint256","name":"_gracePeriod","type":"uint256"}],"name":"setDefaultReceiveLibrary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_lib","type":"address"},{"internalType":"uint256","name":"_expiry","type":"uint256"}],"name":"setDefaultReceiveLibraryTimeout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_newLib","type":"address"}],"name":"setDefaultSendLibrary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegate","type":"address"}],"name":"setDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lzToken","type":"address"}],"name":"setLzToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_newLib","type":"address"},{"internalType":"uint256","name":"_gracePeriod","type":"uint256"}],"name":"setReceiveLibrary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_lib","type":"address"},{"internalType":"uint256","name":"_expiry","type":"uint256"}],"name":"setReceiveLibraryTimeout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_newLib","type":"address"}],"name":"setSendLibrary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"},{"internalType":"bytes32","name":"_sender","type":"bytes32"},{"internalType":"uint64","name":"_nonce","type":"uint64"}],"name":"skip","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"verifiable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"verify","outputs":[],"stateMutability":"nonpayable","type":"function"}]} +{"abi":[{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"LZ_AlreadyRegistered","type":"error"},{"inputs":[],"name":"LZ_ComposeExists","type":"error"},{"inputs":[{"internalType":"bytes32","name":"expected","type":"bytes32"},{"internalType":"bytes32","name":"actual","type":"bytes32"}],"name":"LZ_ComposeNotFound","type":"error"},{"inputs":[],"name":"LZ_DefaultReceiveLibUnavailable","type":"error"},{"inputs":[],"name":"LZ_DefaultSendLibUnavailable","type":"error"},{"inputs":[{"internalType":"uint256","name":"requiredNative","type":"uint256"},{"internalType":"uint256","name":"suppliedNative","type":"uint256"},{"internalType":"uint256","name":"requiredLzToken","type":"uint256"},{"internalType":"uint256","name":"suppliedLzToken","type":"uint256"}],"name":"LZ_InsufficientFee","type":"error"},{"inputs":[],"name":"LZ_InvalidExpiry","type":"error"},{"inputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"name":"LZ_InvalidNonce","type":"error"},{"inputs":[],"name":"LZ_InvalidPayloadHash","type":"error"},{"inputs":[],"name":"LZ_InvalidReceiveLibrary","type":"error"},{"inputs":[],"name":"LZ_LzTokenUnavailable","type":"error"},{"inputs":[],"name":"LZ_OnlyNonDefaultLib","type":"error"},{"inputs":[],"name":"LZ_OnlyReceiveLib","type":"error"},{"inputs":[],"name":"LZ_OnlyRegisteredLib","type":"error"},{"inputs":[],"name":"LZ_OnlyRegisteredOrDefaultLib","type":"error"},{"inputs":[],"name":"LZ_OnlySendLib","type":"error"},{"inputs":[],"name":"LZ_PathNotInitializable","type":"error"},{"inputs":[],"name":"LZ_PathNotVerifiable","type":"error"},{"inputs":[{"internalType":"bytes32","name":"expected","type":"bytes32"},{"internalType":"bytes32","name":"actual","type":"bytes32"}],"name":"LZ_PayloadHashNotFound","type":"error"},{"inputs":[],"name":"LZ_SameValue","type":"error"},{"inputs":[],"name":"LZ_SendReentrancy","type":"error"},{"inputs":[],"name":"LZ_Unauthorized","type":"error"},{"inputs":[],"name":"LZ_UnsupportedEid","type":"error"},{"inputs":[],"name":"LZ_UnsupportedInterface","type":"error"},{"inputs":[],"name":"LZ_ZeroLzTokenFee","type":"error"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"Transfer_NativeFailed","type":"error"},{"inputs":[],"name":"Transfer_ToAddressIsZero","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint16","name":"index","type":"uint16"}],"name":"ComposeDelivered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint16","name":"index","type":"uint16"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"}],"name":"ComposeSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"newLib","type":"address"}],"name":"DefaultReceiveLibrarySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"oldLib","type":"address"},{"indexed":false,"internalType":"uint256","name":"expiry","type":"uint256"}],"name":"DefaultReceiveLibraryTimeoutSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"newLib","type":"address"}],"name":"DefaultSendLibrarySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"delegate","type":"address"}],"name":"DelegateSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"srcEid","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"sender","type":"bytes32"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"}],"name":"InboundNonceSkipped","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newLib","type":"address"}],"name":"LibraryRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"indexed":false,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint16","name":"index","type":"uint16"},{"indexed":false,"internalType":"uint256","name":"gas","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"extraData","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"reason","type":"bytes"}],"name":"LzComposeAlert","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"executor","type":"address"},{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"indexed":false,"internalType":"struct Origin","name":"origin","type":"tuple"},{"indexed":false,"internalType":"bytes32","name":"guid","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"gas","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"message","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"extraData","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"reason","type":"bytes"}],"name":"LzReceiveAlert","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"LzTokenSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"srcEid","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"sender","type":"bytes32"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"name":"PacketBurnt","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"indexed":false,"internalType":"struct Origin","name":"origin","type":"tuple"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"PacketDelivered","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"srcEid","type":"uint32"},{"indexed":false,"internalType":"bytes32","name":"sender","type":"bytes32"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint64","name":"nonce","type":"uint64"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"name":"PacketNilified","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"encodedPayload","type":"bytes"},{"indexed":false,"internalType":"bytes","name":"options","type":"bytes"},{"indexed":false,"internalType":"address","name":"sendLibrary","type":"address"}],"name":"PacketSent","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"indexed":false,"internalType":"struct Origin","name":"origin","type":"tuple"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"name":"PacketVerified","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"newLib","type":"address"}],"name":"ReceiveLibrarySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"oldLib","type":"address"},{"indexed":false,"internalType":"uint256","name":"timeout","type":"uint256"}],"name":"ReceiveLibraryTimeoutSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"indexed":false,"internalType":"address","name":"newLib","type":"address"}],"name":"SendLibrarySet","type":"event"},{"inputs":[],"name":"EMPTY_PAYLOAD_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"NIL_PAYLOAD_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"blockedLibrary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"},{"internalType":"bytes32","name":"_sender","type":"bytes32"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"}],"name":"clear","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint16","name":"index","type":"uint16"}],"name":"composeQueue","outputs":[{"internalType":"bytes32","name":"messageHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"srcEid","type":"uint32"}],"name":"defaultReceiveLibrary","outputs":[{"internalType":"address","name":"lib","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"srcEid","type":"uint32"}],"name":"defaultReceiveLibraryTimeout","outputs":[{"internalType":"address","name":"lib","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"dstEid","type":"uint32"}],"name":"defaultSendLibrary","outputs":[{"internalType":"address","name":"lib","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oapp","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"delegate","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eid","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"executable","outputs":[{"internalType":"enum ExecutionState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"address","name":"_lib","type":"address"},{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"uint32","name":"_configType","type":"uint32"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"config","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"}],"name":"getReceiveLibrary","outputs":[{"internalType":"address","name":"lib","type":"address"},{"internalType":"bool","name":"isDefault","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRegisteredLibraries","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSendContext","outputs":[{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint32","name":"_dstEid","type":"uint32"}],"name":"getSendLibrary","outputs":[{"internalType":"address","name":"lib","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"},{"internalType":"bytes32","name":"_sender","type":"bytes32"}],"name":"inboundNonce","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"inboundNonce","type":"uint64"}],"name":"inboundPayloadHash","outputs":[{"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"initializable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint32","name":"_dstEid","type":"uint32"}],"name":"isDefaultSendLibrary","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"lib","type":"address"}],"name":"isRegisteredLibrary","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isSendingMessage","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"}],"name":"isSupportedEid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"},{"internalType":"address","name":"_actualReceiveLib","type":"address"}],"name":"isValidReceiveLibrary","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"}],"name":"lazyInboundNonce","outputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"uint16","name":"_index","type":"uint16"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzCompose","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"uint16","name":"_index","type":"uint16"},{"internalType":"uint256","name":"_gas","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"bytes","name":"_extraData","type":"bytes"},{"internalType":"bytes","name":"_reason","type":"bytes"}],"name":"lzComposeAlert","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"bytes","name":"_extraData","type":"bytes"}],"name":"lzReceive","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"uint256","name":"_gas","type":"uint256"},{"internalType":"uint256","name":"_value","type":"uint256"},{"internalType":"bytes","name":"_message","type":"bytes"},{"internalType":"bytes","name":"_extraData","type":"bytes"},{"internalType":"bytes","name":"_reason","type":"bytes"}],"name":"lzReceiveAlert","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lzToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nativeToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"},{"internalType":"uint32","name":"_dstEid","type":"uint32"},{"internalType":"bytes32","name":"_receiver","type":"bytes32"}],"name":"nextGuid","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"},{"internalType":"bytes32","name":"_sender","type":"bytes32"},{"internalType":"uint64","name":"_nonce","type":"uint64"},{"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"nilify","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"receiver","type":"bytes32"}],"name":"outboundNonce","outputs":[{"internalType":"uint64","name":"nonce","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"receiver","type":"bytes32"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"bytes","name":"options","type":"bytes"},{"internalType":"bool","name":"payInLzToken","type":"bool"}],"internalType":"struct MessagingParams","name":"_params","type":"tuple"},{"internalType":"address","name":"_sender","type":"address"}],"name":"quote","outputs":[{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint32","name":"srcEid","type":"uint32"}],"name":"receiveLibraryTimeout","outputs":[{"internalType":"address","name":"lib","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lib","type":"address"}],"name":"registerLibrary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstEid","type":"uint32"},{"internalType":"bytes32","name":"receiver","type":"bytes32"},{"internalType":"bytes","name":"message","type":"bytes"},{"internalType":"bytes","name":"options","type":"bytes"},{"internalType":"bool","name":"payInLzToken","type":"bool"}],"internalType":"struct MessagingParams","name":"_params","type":"tuple"},{"internalType":"address","name":"_refundAddress","type":"address"}],"name":"send","outputs":[{"components":[{"internalType":"bytes32","name":"guid","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"},{"components":[{"internalType":"uint256","name":"nativeFee","type":"uint256"},{"internalType":"uint256","name":"lzTokenFee","type":"uint256"}],"internalType":"struct MessagingFee","name":"fee","type":"tuple"}],"internalType":"struct MessagingReceipt","name":"","type":"tuple"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"bytes32","name":"_guid","type":"bytes32"},{"internalType":"uint16","name":"_index","type":"uint16"},{"internalType":"bytes","name":"_message","type":"bytes"}],"name":"sendCompose","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"address","name":"_lib","type":"address"},{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint32","name":"configType","type":"uint32"},{"internalType":"bytes","name":"config","type":"bytes"}],"internalType":"struct SetConfigParam[]","name":"_params","type":"tuple[]"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_newLib","type":"address"},{"internalType":"uint256","name":"_gracePeriod","type":"uint256"}],"name":"setDefaultReceiveLibrary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_lib","type":"address"},{"internalType":"uint256","name":"_expiry","type":"uint256"}],"name":"setDefaultReceiveLibraryTimeout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_newLib","type":"address"}],"name":"setDefaultSendLibrary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_delegate","type":"address"}],"name":"setDelegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_lzToken","type":"address"}],"name":"setLzToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_newLib","type":"address"},{"internalType":"uint256","name":"_gracePeriod","type":"uint256"}],"name":"setReceiveLibrary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_lib","type":"address"},{"internalType":"uint256","name":"_expiry","type":"uint256"}],"name":"setReceiveLibraryTimeout","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_newLib","type":"address"}],"name":"setSendLibrary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_srcEid","type":"uint32"},{"internalType":"bytes32","name":"_sender","type":"bytes32"},{"internalType":"uint64","name":"_nonce","type":"uint64"}],"name":"skip","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"}],"name":"verifiable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"srcEid","type":"uint32"},{"internalType":"bytes32","name":"sender","type":"bytes32"},{"internalType":"uint64","name":"nonce","type":"uint64"}],"internalType":"struct Origin","name":"_origin","type":"tuple"},{"internalType":"address","name":"_receiver","type":"address"},{"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"verify","outputs":[],"stateMutability":"nonpayable","type":"function"}]} \ No newline at end of file diff --git a/workers/abi/ReceiveLibUln302.json b/workers/abi/ReceiveLibUln302.json deleted file mode 100644 index 9b9ad405..00000000 --- a/workers/abi/ReceiveLibUln302.json +++ /dev/null @@ -1 +0,0 @@ -{"abi":[{"inputs":[{"internalType":"address","name":"_endpoint","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"LZ_MessageLib_OnlyEndpoint","type":"error"},{"inputs":[],"name":"LZ_ULN_AtLeastOneDVN","type":"error"},{"inputs":[{"internalType":"uint32","name":"configType","type":"uint32"}],"name":"LZ_ULN_InvalidConfigType","type":"error"},{"inputs":[],"name":"LZ_ULN_InvalidConfirmations","type":"error"},{"inputs":[],"name":"LZ_ULN_InvalidEid","type":"error"},{"inputs":[],"name":"LZ_ULN_InvalidOptionalDVNCount","type":"error"},{"inputs":[],"name":"LZ_ULN_InvalidOptionalDVNThreshold","type":"error"},{"inputs":[],"name":"LZ_ULN_InvalidPacketHeader","type":"error"},{"inputs":[],"name":"LZ_ULN_InvalidPacketVersion","type":"error"},{"inputs":[],"name":"LZ_ULN_InvalidRequiredDVNCount","type":"error"},{"inputs":[],"name":"LZ_ULN_Unsorted","type":"error"},{"inputs":[{"internalType":"uint32","name":"eid","type":"uint32"}],"name":"LZ_ULN_UnsupportedEid","type":"error"},{"inputs":[],"name":"LZ_ULN_Verifying","type":"error"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"components":[{"internalType":"uint64","name":"confirmations","type":"uint64"},{"internalType":"uint8","name":"requiredDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNThreshold","type":"uint8"},{"internalType":"address[]","name":"requiredDVNs","type":"address[]"},{"internalType":"address[]","name":"optionalDVNs","type":"address[]"}],"internalType":"struct UlnConfig","name":"config","type":"tuple"}],"indexed":false,"internalType":"struct SetDefaultUlnConfigParam[]","name":"params","type":"tuple[]"}],"name":"DefaultUlnConfigsSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"dvn","type":"address"},{"indexed":false,"internalType":"bytes","name":"header","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"confirmations","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"proofHash","type":"bytes32"}],"name":"PayloadVerified","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oapp","type":"address"},{"indexed":false,"internalType":"uint32","name":"eid","type":"uint32"},{"components":[{"internalType":"uint64","name":"confirmations","type":"uint64"},{"internalType":"uint8","name":"requiredDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNThreshold","type":"uint8"},{"internalType":"address[]","name":"requiredDVNs","type":"address[]"},{"internalType":"address[]","name":"optionalDVNs","type":"address[]"}],"indexed":false,"internalType":"struct UlnConfig","name":"config","type":"tuple"}],"name":"UlnConfigSet","type":"event"},{"inputs":[{"internalType":"bytes","name":"_packetHeader","type":"bytes"},{"internalType":"uint32","name":"_localEid","type":"uint32"}],"name":"assertHeader","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"_packetHeader","type":"bytes"},{"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"commitVerification","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_remoteEid","type":"uint32"}],"name":"getAppUlnConfig","outputs":[{"components":[{"internalType":"uint64","name":"confirmations","type":"uint64"},{"internalType":"uint8","name":"requiredDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNThreshold","type":"uint8"},{"internalType":"address[]","name":"requiredDVNs","type":"address[]"},{"internalType":"address[]","name":"optionalDVNs","type":"address[]"}],"internalType":"struct UlnConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"},{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_configType","type":"uint32"}],"name":"getConfig","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"internalType":"uint32","name":"_remoteEid","type":"uint32"}],"name":"getUlnConfig","outputs":[{"components":[{"internalType":"uint64","name":"confirmations","type":"uint64"},{"internalType":"uint8","name":"requiredDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNThreshold","type":"uint8"},{"internalType":"address[]","name":"requiredDVNs","type":"address[]"},{"internalType":"address[]","name":"optionalDVNs","type":"address[]"}],"internalType":"struct UlnConfig","name":"rtnConfig","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"headerHash","type":"bytes32"},{"internalType":"bytes32","name":"payloadHash","type":"bytes32"},{"internalType":"address","name":"dvn","type":"address"}],"name":"hashLookup","outputs":[{"internalType":"bool","name":"submitted","type":"bool"},{"internalType":"uint64","name":"confirmations","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_eid","type":"uint32"}],"name":"isSupportedEid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"messageLibType","outputs":[{"internalType":"enum MessageLibType","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oapp","type":"address"},{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"internalType":"uint32","name":"configType","type":"uint32"},{"internalType":"bytes","name":"config","type":"bytes"}],"internalType":"struct SetConfigParam[]","name":"_params","type":"tuple[]"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"eid","type":"uint32"},{"components":[{"internalType":"uint64","name":"confirmations","type":"uint64"},{"internalType":"uint8","name":"requiredDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNThreshold","type":"uint8"},{"internalType":"address[]","name":"requiredDVNs","type":"address[]"},{"internalType":"address[]","name":"optionalDVNs","type":"address[]"}],"internalType":"struct UlnConfig","name":"config","type":"tuple"}],"internalType":"struct SetDefaultUlnConfigParam[]","name":"_params","type":"tuple[]"}],"name":"setDefaultUlnConfigs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"_interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint64","name":"confirmations","type":"uint64"},{"internalType":"uint8","name":"requiredDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNCount","type":"uint8"},{"internalType":"uint8","name":"optionalDVNThreshold","type":"uint8"},{"internalType":"address[]","name":"requiredDVNs","type":"address[]"},{"internalType":"address[]","name":"optionalDVNs","type":"address[]"}],"internalType":"struct UlnConfig","name":"_config","type":"tuple"},{"internalType":"bytes32","name":"_headerHash","type":"bytes32"},{"internalType":"bytes32","name":"_payloadHash","type":"bytes32"}],"name":"verifiable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_packetHeader","type":"bytes"},{"internalType":"bytes32","name":"_payloadHash","type":"bytes32"},{"internalType":"uint64","name":"_confirmations","type":"uint64"}],"name":"verify","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint64","name":"major","type":"uint64"},{"internalType":"uint8","name":"minor","type":"uint8"},{"internalType":"uint8","name":"endpointVersion","type":"uint8"}],"stateMutability":"pure","type":"function"}]} diff --git a/workers/src/bin/executor.rs b/workers/src/bin/executor.rs new file mode 100644 index 00000000..6b304fd1 --- /dev/null +++ b/workers/src/bin/executor.rs @@ -0,0 +1,25 @@ +use tracing::level_filters::LevelFilter; +use tracing_subscriber::EnvFilter; +use workers::config; +use workers::executor_def::NFFLExecutor; + +/// Executor is expected to work with low work rate, and we have a bonus +/// from this observation - we don't need/want to care about concurrency control, +/// so we choose run single-threaded runtime so far. +#[tokio::main(flavor = "current_thread")] +async fn main() -> eyre::Result<()> { + // Initialize tracing + tracing_subscriber::fmt() + .with_target(false) + .with_env_filter( + EnvFilter::builder() + .with_default_directive(LevelFilter::DEBUG.into()) + .from_env_lossy(), + ) + .init(); + + let mut executor = NFFLExecutor::new(config::DVNConfig::load_from_env()?); + executor.listen().await?; + + Ok(()) +} diff --git a/workers/src/chain/connections.rs b/workers/src/chain/connections.rs index b1763323..03efd71d 100644 --- a/workers/src/chain/connections.rs +++ b/workers/src/chain/connections.rs @@ -2,7 +2,7 @@ use crate::{ chain::HttpProvider, - config::{DVNConfig, DVNEvent}, + config::{DVNConfig, LayerZeroEvent}, }; use alloy::{ eips::BlockNumberOrTag, @@ -28,13 +28,13 @@ pub async fn build_subscriptions( // layerzero endpoint filter let packet_filter = Filter::new() .address(config.l0_endpoint_addr) - .event(DVNEvent::PacketSent.as_ref()) + .event(LayerZeroEvent::PacketSent.as_ref()) .from_block(BlockNumberOrTag::Latest); // messagelib endpoint filter let fee_paid_filter = Filter::new() .address(config.sendlib_uln302_addr) - .event(DVNEvent::FeePaid.as_ref()) + .event(LayerZeroEvent::DVNFeePaid.as_ref()) .from_block(BlockNumberOrTag::Latest); // Subscribe to logs @@ -48,6 +48,40 @@ pub async fn build_subscriptions( Ok((provider, endpoint_stream, sendlib_stream)) } +pub async fn build_executor_subscriptions( + config: &DVNConfig, +) -> Result<( + SubscriptionStream, + SubscriptionStream, + SubscriptionStream, +)> { + // Create the provider + let ws = WsConnect::new(&config.ws_rpc_url); + let provider = ProviderBuilder::new().on_ws(ws).await?; + + // PacketSent + let packet_sent_filter = Filter::new() + .address(config.l0_endpoint_addr) + .event(LayerZeroEvent::PacketSent.as_ref()) + .from_block(BlockNumberOrTag::Latest); + + let executor_fee_paid = Filter::new() + .address(config.sendlib_uln302_addr) + .event(LayerZeroEvent::ExecutorFeePaid.as_ref()) + .from_block(BlockNumberOrTag::Latest); + + let packet_verified_filter = Filter::new() + .address(config.l0_endpoint_addr) + .event(LayerZeroEvent::PacketVerified.as_ref()) + .from_block(BlockNumberOrTag::Latest); + + Ok(( + provider.subscribe_logs(&packet_sent_filter).await?.into_stream(), + provider.subscribe_logs(&executor_fee_paid).await?.into_stream(), + provider.subscribe_logs(&packet_verified_filter).await?.into_stream(), + )) +} + /// Load the MessageLib ABI. pub fn get_abi_from_path(path: &str) -> Result { // Get the SendLib ABI diff --git a/workers/src/chain/contracts.rs b/workers/src/chain/contracts.rs index 51d44c80..764f53d7 100644 --- a/workers/src/chain/contracts.rs +++ b/workers/src/chain/contracts.rs @@ -1,6 +1,8 @@ //! Utilities for interacting with onchain contracts. use crate::chain::{ContractInst, HttpProvider}; +use crate::data::packet_v1_codec::{guid, header, message, nonce, receiver, sender, src_eid}; +use alloy::primitives::B256; use alloy::{ contract::{ContractInstance, Interface}, dyn_abi::DynSolValue, @@ -143,3 +145,50 @@ pub async fn verify(contract: &ContractInst, packet_header: &[u8], payload: &[u8 Ok(()) } + +/// If the state is `Executable`, your `Executor` should decode the packet's options +/// using the options.ts package and call the Endpoint's `lzReceive` function with +/// the packet information: +/// `endpoint.lzReceive(_origin, _receiver, _guid, _message, _extraData)` +pub async fn lz_receive(contract: &ContractInst, packet: &[u8]) -> Result<()> { + let guid = guid(packet); + let call_builder_result = contract.function( + "lzReceive", + &[ + prepare_header(header(packet)), + DynSolValue::Address(Address::from_slice(&receiver(packet)[0..20])), + DynSolValue::FixedBytes(B256::from_slice(guid.as_slice()), 32), + DynSolValue::Bytes(message(packet).to_vec()), + DynSolValue::Bytes(vec![]), + ], + ); + + if call_builder_result.is_err() { + error!("Failed to call lzReceive, because it doesn't exist in the contract/ABI."); + return Ok(()); + } + + call_builder_result.unwrap().call().await.map_err(|e| { + error!("Failed to call lzReceive for packet {:?}: {:?}", guid, e); + eyre!("lzReceive call failed: {}", e) + })?; + debug!("Successfully called lzReceive for packet {:?}", guid); + Ok(()) +} + +/// Converts `Origin` data structure from the received `PacketVerified` +/// to the `DynSolValue`, understandable by `alloy-rs`. +pub(crate) fn prepare_header(packet: &[u8]) -> DynSolValue { + const ORIGIN_STRUCT_NAME: &str = "Origin"; + const ORIGIN_PROPS: [&str; 3] = ["srcEid", "sender", "nonce"]; + + DynSolValue::CustomStruct { + name: String::from(ORIGIN_STRUCT_NAME), + prop_names: ORIGIN_PROPS.iter().map(|&s| String::from(s)).collect(), + tuple: vec![ + DynSolValue::Uint(U256::from(src_eid(packet)), 32), + DynSolValue::FixedBytes(B256::from_slice(sender(packet).as_ref()), 32), + DynSolValue::Uint(U256::from(nonce(packet)), 64), + ], + } +} diff --git a/workers/src/config.rs b/workers/src/config.rs index 45cfc5d2..bfc547c5 100644 --- a/workers/src/config.rs +++ b/workers/src/config.rs @@ -1,4 +1,4 @@ -//! Configuration for the DVN offchain workflow. +//! Configuration for the DVN off-chain workflow. use alloy::primitives::Address; use config::Config; @@ -40,16 +40,20 @@ impl DVNConfig { } /// Useful events for the DVN workflow. -pub enum DVNEvent { +pub enum LayerZeroEvent { PacketSent, - FeePaid, + DVNFeePaid, + ExecutorFeePaid, + PacketVerified, } -impl AsRef for DVNEvent { +impl AsRef for LayerZeroEvent { fn as_ref(&self) -> &str { match self { - DVNEvent::PacketSent => "PacketSent(bytes,bytes,address)", - DVNEvent::FeePaid => "DVNFeePaid(address[],address[],uint256[])", + LayerZeroEvent::PacketSent => "PacketSent(bytes,bytes,address)", + LayerZeroEvent::DVNFeePaid => "DVNFeePaid(address[],address[],uint256[])", + LayerZeroEvent::ExecutorFeePaid => "ExecutorFeePaid(address,uint256)", + LayerZeroEvent::PacketVerified => "PacketVerified(address,bytes,uint256,bytes32)", } } } diff --git a/workers/src/executor_def.rs b/workers/src/executor_def.rs new file mode 100644 index 00000000..aad5923c --- /dev/null +++ b/workers/src/executor_def.rs @@ -0,0 +1,166 @@ +use crate::abi::L0V2EndpointAbi::PacketSent; +use crate::abi::L0V2EndpointAbi::PacketVerified; +use crate::abi::SendLibraryAbi::ExecutorFeePaid; +use crate::chain::connections::build_executor_subscriptions; +use crate::chain::connections::get_abi_from_path; +use crate::chain::connections::get_http_provider; +use crate::chain::contracts::create_contract_instance; +use crate::chain::contracts::{lz_receive, prepare_header}; +use crate::chain::ContractInst; +use crate::config::DVNConfig; +use alloy::dyn_abi::DynSolValue; +use alloy::primitives::U256; +use eyre::Result; +use futures::StreamExt; +use std::collections::VecDeque; +use std::time::Duration; +use tokio::time::sleep; +use tracing::{debug, error}; + +#[derive(Debug, Clone, Copy, PartialEq)] +pub enum ExecutionState { + NotExecutable = 0, + VerifiedNotExecutable = 1, + Executable = 2, + Executed = 3, +} + +pub struct NFFLExecutor { + config: DVNConfig, + packet_queue: VecDeque, + finish: bool, +} + +impl NFFLExecutor { + pub(crate) const MAX_EXECUTE_ATTEMPTS: usize = 10; + + pub fn new(config: DVNConfig) -> Self { + NFFLExecutor { + config, + packet_queue: VecDeque::new(), + finish: false, + } + } + + pub fn finish(&mut self) { + // Note: we are in a single-threaded event loop, and we do not care about atomicity (yet). + self.finish = true; + } + + pub async fn listen(&mut self) -> Result<()> { + let (mut ps_stream, mut ef_stream, mut pv_stream) = build_executor_subscriptions(&self.config).await?; + + let http_provider = get_http_provider(&self.config)?; + let l0_abi = get_abi_from_path("./abi/L0V2Endpoint.json")?; + // Create a contract instance. + let contract = create_contract_instance(self.config.l0_endpoint_addr, http_provider, l0_abi)?; + + loop { + tokio::select! { + Some(log) = ps_stream.next() => { + match log.log_decode::() { + Ok(packet_log) => { + self.packet_queue.push_back(packet_log.data().clone()); + }, + Err(e) => { error!("Failed to decode PacketSent event: {:?}", e);} + } + } + Some(log) = ef_stream.next() => { + match log.log_decode::() { + Ok(executor_fee_log) => { + if self.packet_queue.is_empty() { + continue; + } + + if !executor_fee_log.data().executor.eq(&self.config.dvn_addr) { + self.packet_queue.clear(); + continue; + } + }, + Err(e) => { error!("Failed to decode ExecutorFeePaid event: {:?}", e);} + } + }, + Some(log) = pv_stream.next() => { + match log.log_decode::() { + Ok(inner_log) => { + Self::handle_verified_packet(&contract, &mut self.packet_queue, inner_log.data()).await?; + }, + Err(e) => { error!("Failed to decode PacketVerified event: {:?}", e);} + } + }, + } + if self.finish { + break; + } + } + Ok(()) + } + + #[cfg(test)] + pub fn is_queue_empty(&self) -> bool { + self.packet_queue.is_empty() + } + + pub async fn handle_verified_packet( + contract: &ContractInst, + queue: &mut VecDeque, + packet_verified: &PacketVerified, + ) -> Result<()> { + if queue.is_empty() { + return Ok(()); + } + + let packet_sent = queue.pop_front().unwrap(); + // We don't expect any more items to be present. If we have any - they are garbage/leftovers. + queue.clear(); + // Despite being described with other arguments, the only real implementation of + // `executable` function is in the contract located here: https://shorturl.at/4H6Yz + // function executable(Origin memory _origin, address _receiver) returns (ExecutionState) + let call_builder = contract.function( + "executable", + &[ + prepare_header(&packet_sent.encodedPayload[..]), + DynSolValue::Address(packet_verified.receiver), + ], + )?; + + let mut retry_count = 0; + // status `Executable` is represented by the integer 2 in the enum. + // To read more: https://tinyurl.com/zur3btzs (line 9) + let not_executable = DynSolValue::Uint(U256::from(ExecutionState::NotExecutable as u8), 8); + let verified_not_executable = DynSolValue::Uint(U256::from(ExecutionState::VerifiedNotExecutable as u8), 8); + let executable = DynSolValue::Uint(U256::from(ExecutionState::Executable as u8), 8); + let executed = DynSolValue::Uint(U256::from(ExecutionState::Executed as u8), 8); + loop { + debug!("Attempt #{retry_count} to call 'executable'"); + if retry_count == Self::MAX_EXECUTE_ATTEMPTS { + error!("Maximum retries reached while waiting for `Executable` state."); + break; + } + let call_result = call_builder.call().await?; + if call_result.len() != 1 { + error!("`executable` function call returned invalid response."); + break; + } + + // Note: why not pattern matching here? fn calls are not allowed in patterns + if call_result[0].eq(¬_executable) || call_result[0].eq(&verified_not_executable) { + debug!("State: NotExecutable or VerifiedNotExecutable, await commits/verifications"); + sleep(Duration::from_secs(1)).await; + retry_count += 1; + continue; + } else if call_result[0].eq(&executable) { + debug!("State: Executable, fire and forget `lzReceive`"); + lz_receive(contract, &packet_sent.encodedPayload[..]).await?; + break; + } else if call_result[0].eq(&executed) { + debug!("State: Executed, free the executor"); + break; + } else { + error!("Unknown state for `executable` call"); + break; + } + } + Ok(()) + } +} diff --git a/workers/src/lib.rs b/workers/src/lib.rs index 0b99f175..664ab4ea 100644 --- a/workers/src/lib.rs +++ b/workers/src/lib.rs @@ -4,4 +4,5 @@ pub mod abi; pub mod chain; pub mod config; pub mod data; +pub mod executor_def; pub mod verifier; diff --git a/workers/tests/executor_it.rs b/workers/tests/executor_it.rs new file mode 100644 index 00000000..55b67526 --- /dev/null +++ b/workers/tests/executor_it.rs @@ -0,0 +1,112 @@ +#[cfg(test)] +mod tests { + use alloy::primitives::{address, Address, Bytes, FixedBytes}; + use alloy::providers::ProviderBuilder; + + use axum::{routing::post, Json, Router}; + use std::collections::VecDeque; + use std::sync::atomic::{AtomicI32, Ordering}; + use std::sync::Arc; + use tokio::task::JoinHandle; + use tracing::debug; + use tracing::level_filters::LevelFilter; + use tracing_subscriber::EnvFilter; + use workers::abi::L0V2EndpointAbi::{Origin, PacketSent, PacketVerified}; + use workers::chain::connections::get_abi_from_path; + use workers::chain::contracts::create_contract_instance; + use workers::chain::ContractInst; + use workers::executor_def::NFFLExecutor; + + #[derive(serde::Serialize, serde::Deserialize, Debug)] + struct EthCallRequest { + method: String, + params: Vec, + id: u32, + jsonrpc: String, + } + + #[derive(serde::Serialize, serde::Deserialize, Debug)] + struct EthCallResponse { + result: String, + id: u32, + jsonrpc: String, + } + + #[tokio::test] + async fn test_handle_verified_packet_success() -> eyre::Result<()> { + // Initialize tracing + tracing_subscriber::fmt() + .with_target(true) + .with_env_filter( + EnvFilter::builder() + .with_default_directive(LevelFilter::DEBUG.into()) + .from_env_lossy(), + ) + .init(); + + let counter: Arc = Arc::new(AtomicI32::new(0)); + let mut queue: VecDeque = VecDeque::new(); + let verified_packet = PacketVerified { + origin: Origin { + srcEid: 1, + sender: FixedBytes::from(&[1; 32]), + nonce: 101010, + }, + receiver: Address::from_slice(&[1; 20]), + payloadHash: FixedBytes::from(&[2; 32]), + }; + + let join_handle = prepare_server(counter.clone()).await; + let contract = setup_contract(&mut queue).await?; + + NFFLExecutor::handle_verified_packet(&contract, &mut queue, &verified_packet).await?; + + assert_eq!(counter.load(Ordering::Acquire), 2); + Ok(()) + } + + async fn prepare_server(counter: Arc) -> JoinHandle<()> { + const SERVER_ADDRESS_SHORT: &str = "127.0.0.1:8081"; + + // Define the handler for the POST request. + let app = Router::new().route( + "/", + post(|| async move { + debug!("Server : POST request accepted"); + counter.fetch_add(1, Ordering::Release); + Json(EthCallResponse { + result: "0x0000000000000000000000000000000000000000000000000000000000000002".to_string(), + id: 1, + jsonrpc: "2.0".to_string(), + }) + }), + ); + // Spawn the server on a background task. + let listener = tokio::net::TcpListener::bind(SERVER_ADDRESS_SHORT).await.unwrap(); + + debug!("Listening on {}", listener.local_addr().unwrap()); + + tokio::spawn(async move { axum::serve(listener, app).await.unwrap() }) + } + + async fn setup_contract(packet_sent_queue: &mut VecDeque) -> eyre::Result { + const SERVER_ADDRESS: &str = "http://127.0.0.1:8081"; + + let http_provider = ProviderBuilder::new().on_http(SERVER_ADDRESS.parse()?); + let l0_abi = get_abi_from_path("./abi/L0V2Endpoint.json")?; + + debug!("{:?}", l0_abi.functions.iter().map(|f| f.0).collect::>()); + + packet_sent_queue.push_back(PacketSent { + encodedPayload: Bytes::from(&[1; 256]), + options: Bytes::from(&[1; 32]), + sendLibrary: Address::from_slice(&[2; 20]), + }); + + create_contract_instance( + address!("d8da6bf26964af9d7eed9e03e53415d37aa96045"), + http_provider, + l0_abi, + ) + } +}