diff --git a/Cargo.lock b/Cargo.lock index 208fb54..a8ef687 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -229,7 +229,7 @@ dependencies = [ [[package]] name = "amplifier-api" version = "0.1.1" -source = "git+https://github.com/eigerco/axelar-relayer-core.git?branch=main#f4b8b4a6c30bd070263ea4f4ad09ab647e089293" +source = "git+https://github.com/eigerco/axelar-relayer-core.git?rev=7f84b8d#7f84b8d20ec399cce16bd4a2deb26d848afa7760" dependencies = [ "base64 0.22.1", "bnum 0.12.1", @@ -708,13 +708,13 @@ dependencies = [ [[package]] name = "axelar-executable" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "alloy-sol-types", "axelar-solana-encoding", "axelar-solana-gateway", "borsh 1.5.3", - "num-derive", + "num-derive 0.4.2", "num-traits", "solana-program", "thiserror 1.0.69", @@ -723,7 +723,7 @@ dependencies = [ [[package]] name = "axelar-message-primitives" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -739,7 +739,7 @@ dependencies = [ [[package]] name = "axelar-solana-encoding" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "arrayref", "borsh 1.5.3", @@ -756,7 +756,7 @@ dependencies = [ [[package]] name = "axelar-solana-gas-service" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "borsh 1.5.3", "bytemuck", @@ -770,7 +770,7 @@ dependencies = [ [[package]] name = "axelar-solana-gateway" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "axelar-message-primitives", "axelar-solana-encoding", @@ -782,7 +782,7 @@ dependencies = [ "hex", "itertools 0.12.1", "libsecp256k1", - "num-derive", + "num-derive 0.4.2", "num-traits", "program-utils", "role-management", @@ -793,7 +793,7 @@ dependencies = [ [[package]] name = "axelar-solana-gateway-test-fixtures" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "axelar-executable", "axelar-solana-encoding", @@ -819,7 +819,7 @@ dependencies = [ [[package]] name = "axelar-solana-governance" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "alloy-sol-types", "axelar-executable", @@ -835,7 +835,7 @@ dependencies = [ [[package]] name = "axelar-solana-its" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -847,31 +847,29 @@ dependencies = [ "bitflags 2.7.0", "borsh 1.5.3", "interchain-token-transfer-gmp", + "mpl-token-metadata", "program-utils", "role-management", "solana-program", "spl-associated-token-account 5.0.1", - "spl-pod 0.4.0", "spl-token", "spl-token-2022 5.0.2", - "spl-token-metadata-interface 0.5.1", "typed-builder 0.20.0", ] [[package]] name = "axelar-solana-memo-program" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "axelar-executable", "axelar-solana-encoding", "axelar-solana-gateway", "axelar-solana-its", "borsh 1.5.3", + "mpl-token-metadata", "program-utils", "solana-program", - "spl-token-2022 5.0.2", - "spl-token-metadata-interface 0.5.1", ] [[package]] @@ -1616,7 +1614,7 @@ dependencies = [ [[package]] name = "common-serde-utils" version = "0.1.1" -source = "git+https://github.com/eigerco/axelar-relayer-core.git?branch=main#f4b8b4a6c30bd070263ea4f4ad09ab647e089293" +source = "git+https://github.com/eigerco/axelar-relayer-core.git?rev=7f84b8d#7f84b8d20ec399cce16bd4a2deb26d848afa7760" dependencies = [ "serde", ] @@ -2688,7 +2686,7 @@ dependencies = [ [[package]] name = "gateway-event-stack" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "axelar-solana-gas-service", "axelar-solana-gateway", @@ -2816,7 +2814,7 @@ dependencies = [ [[package]] name = "governance-gmp" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -3579,7 +3577,7 @@ dependencies = [ [[package]] name = "interchain-token-transfer-gmp" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -3634,7 +3632,7 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "its-instruction-builder" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "async-recursion", "axelar-executable", @@ -4303,6 +4301,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "mpl-token-metadata" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "989e6a3000e761d3b2d685662a3a9ee99826f9369fb033bd1bc7011b1cf02ed9" +dependencies = [ + "borsh 0.10.4", + "num-derive 0.3.3", + "num-traits", + "solana-program", + "thiserror 1.0.69", +] + [[package]] name = "multimap" version = "0.8.3" @@ -4427,6 +4438,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2 1.0.92", + "quote 1.0.38", + "syn 1.0.109", +] + [[package]] name = "num-derive" version = "0.4.2" @@ -5143,7 +5165,7 @@ dependencies = [ [[package]] name = "program-utils" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "borsh 1.5.3", "bytemuck", @@ -5680,7 +5702,7 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "relayer-amplifier-api-integration" version = "0.1.1" -source = "git+https://github.com/eigerco/axelar-relayer-core.git?branch=main#f4b8b4a6c30bd070263ea4f4ad09ab647e089293" +source = "git+https://github.com/eigerco/axelar-relayer-core.git?rev=7f84b8d#7f84b8d20ec399cce16bd4a2deb26d848afa7760" dependencies = [ "amplifier-api", "common-serde-utils 0.1.1", @@ -5701,7 +5723,7 @@ dependencies = [ [[package]] name = "relayer-amplifier-state" version = "0.1.1" -source = "git+https://github.com/eigerco/axelar-relayer-core.git?branch=main#f4b8b4a6c30bd070263ea4f4ad09ab647e089293" +source = "git+https://github.com/eigerco/axelar-relayer-core.git?rev=7f84b8d#7f84b8d20ec399cce16bd4a2deb26d848afa7760" dependencies = [ "amplifier-api", ] @@ -5709,7 +5731,7 @@ dependencies = [ [[package]] name = "relayer-engine" version = "0.1.1" -source = "git+https://github.com/eigerco/axelar-relayer-core.git?branch=main#f4b8b4a6c30bd070263ea4f4ad09ab647e089293" +source = "git+https://github.com/eigerco/axelar-relayer-core.git?rev=7f84b8d#7f84b8d20ec399cce16bd4a2deb26d848afa7760" dependencies = [ "eyre", "serde", @@ -5972,7 +5994,7 @@ dependencies = [ [[package]] name = "role-management" version = "0.1.0" -source = "git+https://github.com/eigerco/solana-axelar.git?rev=c08f0925#c08f0925c3edcf345b9cefbc11bdb985390d5008" +source = "git+https://github.com/eigerco/solana-axelar.git?rev=61b074d460#61b074d46004be34f9a77829bb2034814b588d3b" dependencies = [ "bincode", "bitflags 2.7.0", @@ -6813,7 +6835,7 @@ dependencies = [ "bincode", "bytemuck", "log", - "num-derive", + "num-derive 0.4.2", "num-traits", "rustc_version 0.4.1", "solana-program", @@ -7249,6 +7271,8 @@ version = "0.1.0" dependencies = [ "axelar-solana-gas-service", "axelar-solana-gateway", + "axelar-solana-gateway-test-fixtures", + "axelar-solana-memo-program", "base64 0.22.1", "bs58", "eyre", @@ -7258,9 +7282,15 @@ dependencies = [ "pretty_assertions", "relayer-amplifier-api-integration", "relayer-engine", + "retrying-solana-http-sender", + "solana-gateway-task-processor", "solana-listener", + "solana-rpc", + "solana-rpc-client-api", "solana-sdk", + "solana-test-validator", "test-log", + "tokio", "tracing", ] @@ -7684,7 +7714,7 @@ dependencies = [ "log", "memoffset", "num-bigint 0.4.6", - "num-derive", + "num-derive 0.4.2", "num-traits", "parking_lot 0.12.3", "rand 0.8.5", @@ -7713,7 +7743,7 @@ dependencies = [ "itertools 0.12.1", "libc", "log", - "num-derive", + "num-derive 0.4.2", "num-traits", "percentage", "rand 0.8.5", @@ -7831,7 +7861,7 @@ dependencies = [ "console", "dialoguer", "log", - "num-derive", + "num-derive 0.4.2", "num-traits", "parking_lot 0.12.3", "qstring", @@ -7994,7 +8024,7 @@ dependencies = [ "memmap2 0.5.10", "mockall 0.11.4", "modular-bitfield", - "num-derive", + "num-derive 0.4.2", "num-traits", "num_cpus", "num_enum", @@ -8516,7 +8546,7 @@ checksum = "c767b55ffbe8fdbdcbf20b910fd13e697d4ef4ab9ebdec2899f7ea3beb4820be" dependencies = [ "bincode", "log", - "num-derive", + "num-derive 0.4.2", "num-traits", "rustc_version 0.4.1", "serde", @@ -8560,7 +8590,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6be103cdf655e48867d6648f08bf3792c05c9cbfe9c2b3da18710fd7975bff4" dependencies = [ "bytemuck", - "num-derive", + "num-derive 0.4.2", "num-traits", "solana-program-runtime", "solana-sdk", @@ -8582,7 +8612,7 @@ dependencies = [ "itertools 0.12.1", "lazy_static", "merlin", - "num-derive", + "num-derive 0.4.2", "num-traits", "rand 0.7.3", "serde", @@ -8603,7 +8633,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2e8436c58c93c8b08617a7dc7a825fdd5260b51b9a59543d38a87bedc6cc4ac" dependencies = [ "bytemuck", - "num-derive", + "num-derive 0.4.2", "num-traits", "solana-program-runtime", "solana-sdk", @@ -8626,7 +8656,7 @@ dependencies = [ "itertools 0.12.1", "lazy_static", "merlin", - "num-derive", + "num-derive 0.4.2", "num-traits", "rand 0.7.3", "serde", @@ -8690,7 +8720,7 @@ checksum = "68034596cf4804880d265f834af1ff2f821ad5293e41fa0f8f59086c181fc38e" dependencies = [ "assert_matches", "borsh 1.5.3", - "num-derive", + "num-derive 0.4.2", "num-traits", "solana-program", "spl-token", @@ -8705,7 +8735,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "714b53f7312c2802c62f14bc8a07916c2c872761e3d6be97e99fd432be7799ca" dependencies = [ "borsh 1.5.3", - "num-derive", + "num-derive 0.4.2", "num-traits", "solana-program", "spl-associated-token-account-client", @@ -8802,7 +8832,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7b28bed65356558133751cc32b48a7a5ddfc59ac4e941314630bbed1ac10532" dependencies = [ - "num-derive", + "num-derive 0.4.2", "num-traits", "solana-program", "spl-program-error-derive", @@ -8857,7 +8887,7 @@ checksum = "70a0f06ac7f23dc0984931b1fe309468f14ea58e32660439c1cef19456f5d0e3" dependencies = [ "arrayref", "bytemuck", - "num-derive", + "num-derive 0.4.2", "num-traits", "num_enum", "solana-program", @@ -8872,7 +8902,7 @@ checksum = "d9c10f3483e48679619c76598d4e4aebb955bc49b0a5cc63323afbf44135c9bf" dependencies = [ "arrayref", "bytemuck", - "num-derive", + "num-derive 0.4.2", "num-traits", "num_enum", "solana-program", @@ -8897,7 +8927,7 @@ dependencies = [ "arrayref", "base64 0.22.1", "bytemuck", - "num-derive", + "num-derive 0.4.2", "num-traits", "num_enum", "serde", @@ -9000,7 +9030,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27c7a6d2a2a4f23c8f051ba2f7edb5689f1b534b4126bd9b4ae4177685e9a341" dependencies = [ "borsh 1.5.3", - "serde", "solana-program", "spl-discriminator", "spl-pod 0.4.0", diff --git a/Cargo.toml b/Cargo.toml index 7c15c19..97989e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,24 +73,24 @@ solana-gateway-task-processor = { path = "crates/solana-gateway-task-processor" effective-tx-sender = { path = "crates/effective-tx-sender" } # Relayer core -amplifier-api = { git = "https://github.com/eigerco/axelar-relayer-core.git", branch = "main" } -relayer-engine = { git = "https://github.com/eigerco/axelar-relayer-core.git", branch = "main" } -relayer-amplifier-api-integration = { git = "https://github.com/eigerco/axelar-relayer-core.git", branch = "main" } -relayer-amplifier-state = { git = "https://github.com/eigerco/axelar-relayer-core.git", branch = "main" } -core-common-serde-utils = { git = "https://github.com/eigerco/axelar-relayer-core.git", package = "common-serde-utils", branch = "main" } +amplifier-api = { git = "https://github.com/eigerco/axelar-relayer-core.git", rev = "7f84b8d" } +relayer-engine = { git = "https://github.com/eigerco/axelar-relayer-core.git", rev = "7f84b8d" } +relayer-amplifier-api-integration = { git = "https://github.com/eigerco/axelar-relayer-core.git", rev = "7f84b8d" } +relayer-amplifier-state = { git = "https://github.com/eigerco/axelar-relayer-core.git", rev = "7f84b8d" } +core-common-serde-utils = { git = "https://github.com/eigerco/axelar-relayer-core.git", package = "common-serde-utils", rev = "7f84b8d" } # Solana Gateway -axelar-solana-gateway = { git = "https://github.com/eigerco/solana-axelar.git", rev = "c08f0925", features = ["no-entrypoint"] } -axelar-solana-its = { git = "https://github.com/eigerco/solana-axelar.git", rev = "c08f0925", features = ["no-entrypoint"] } -axelar-solana-governance = { git = "https://github.com/eigerco/solana-axelar.git", rev = "c08f0925", features = ["no-entrypoint"] } -gateway-event-stack = { git = "https://github.com/eigerco/solana-axelar.git", rev = "c08f0925" } -axelar-solana-encoding = { git = "https://github.com/eigerco/solana-axelar.git", rev = "c08f0925" } -axelar-solana-gas-service = { git = "https://github.com/eigerco/solana-axelar.git", rev = "c08f0925" } -axelar-solana-memo-program = { git = "https://github.com/eigerco/solana-axelar.git", rev = "c08f0925" } -axelar-solana-gateway-test-fixtures = { git = "https://github.com/eigerco/solana-axelar.git", rev = "c08f0925" } -axelar-message-primitives = { git = "https://github.com/eigerco/solana-axelar.git", rev = "c08f0925" } -axelar-executable = { git = "https://github.com/eigerco/solana-axelar.git", rev = "c08f0925" } -its-instruction-builder = { git = "https://github.com/eigerco/solana-axelar.git", rev = "c08f0925" } +axelar-solana-gateway = { git = "https://github.com/eigerco/solana-axelar.git", rev = "61b074d460", features = ["no-entrypoint"] } +axelar-solana-its = { git = "https://github.com/eigerco/solana-axelar.git", rev = "61b074d460", features = ["no-entrypoint"] } +axelar-solana-governance = { git = "https://github.com/eigerco/solana-axelar.git", rev = "61b074d460", features = ["no-entrypoint"] } +gateway-event-stack = { git = "https://github.com/eigerco/solana-axelar.git", rev = "61b074d460" } +axelar-solana-encoding = { git = "https://github.com/eigerco/solana-axelar.git", rev = "61b074d460" } +axelar-solana-gas-service = { git = "https://github.com/eigerco/solana-axelar.git", rev = "61b074d460", features = ["no-entrypoint"] } +axelar-solana-memo-program = { git = "https://github.com/eigerco/solana-axelar.git", rev = "61b074d460", features = ["no-entrypoint"] } +axelar-solana-gateway-test-fixtures = { git = "https://github.com/eigerco/solana-axelar.git", rev = "61b074d460" } +axelar-message-primitives = { git = "https://github.com/eigerco/solana-axelar.git", rev = "61b074d460" } +axelar-executable = { git = "https://github.com/eigerco/solana-axelar.git", rev = "61b074d460" } +its-instruction-builder = { git = "https://github.com/eigerco/solana-axelar.git", rev = "61b074d460" } # CLI clap = { version = "4", features = ["derive"] } diff --git a/crates/solana-axelar-relayer/src/main.rs b/crates/solana-axelar-relayer/src/main.rs index 8a40f1a..84f145e 100644 --- a/crates/solana-axelar-relayer/src/main.rs +++ b/crates/solana-axelar-relayer/src/main.rs @@ -31,6 +31,7 @@ async fn main() { let rpc_client = retrying_solana_http_sender::new_client(&config.solana_rpc); let event_forwarder_config = solana_event_forwarder::Config::new( &config.solana_listener_component, + &config.solana_gateway_task_processor, &config.amplifier_component, ); let name_on_amplifier = config.amplifier_component.chain.clone(); @@ -128,6 +129,8 @@ mod tests { let gateway_program_address_as_str = gateway_program_address.to_string(); let gas_service_config_pda = Pubkey::new_unique(); let gas_service_config_pda_as_str = gas_service_config_pda.to_string(); + let gas_service_program_id = Pubkey::new_unique(); + let gas_service_program_id_as_str = gas_service_program_id.to_string(); let solana_rpc = "https://api.solana-devnet.com".parse()?; let solana_ws = "wss://api.solana-devnet.com".parse()?; let solana_tx_scan_poll_period = Duration::from_millis(42); @@ -166,6 +169,7 @@ mod tests { [solana_gateway_task_processor] signing_keypair = "{signing_keypair_as_str}" gateway_program_address = "{gateway_program_address_as_str}" + gas_service_program_address = "{gas_service_program_id_as_str}" gas_service_config_pda = "{gas_service_config_pda_as_str}" [solana_rpc] @@ -200,6 +204,7 @@ mod tests { }, solana_gateway_task_processor: solana_gateway_task_processor::Config { gateway_program_address, + gas_service_program_address: gas_service_program_id, gas_service_config_pda, signing_keypair, }, diff --git a/crates/solana-event-forwarder/Cargo.toml b/crates/solana-event-forwarder/Cargo.toml index a8cf1a6..f599ba0 100644 --- a/crates/solana-event-forwarder/Cargo.toml +++ b/crates/solana-event-forwarder/Cargo.toml @@ -10,6 +10,7 @@ edition.workspace = true [dependencies] futures.workspace = true axelar-solana-gas-service.workspace = true +solana-gateway-task-processor.workspace = true relayer-amplifier-api-integration.workspace = true solana-listener.workspace = true relayer-engine.workspace = true @@ -23,8 +24,15 @@ gateway-event-stack.workspace = true [dev-dependencies] base64.workspace = true -pretty_assertions.workspace = true +axelar-solana-gateway-test-fixtures.workspace = true +retrying-solana-http-sender.workspace = true +axelar-solana-memo-program.workspace = true +solana-test-validator.workspace = true +solana-rpc-client-api.workspace = true +solana-rpc.workspace = true test-log.workspace = true +tokio.workspace = true +pretty_assertions.workspace = true [lints] workspace = true diff --git a/crates/solana-event-forwarder/src/component.rs b/crates/solana-event-forwarder/src/component.rs index b566ec0..9a23b12 100644 --- a/crates/solana-event-forwarder/src/component.rs +++ b/crates/solana-event-forwarder/src/component.rs @@ -17,7 +17,8 @@ use itertools::Itertools as _; use relayer_amplifier_api_integration::amplifier_api::types::{ BigInt, CallEvent, CallEventMetadata, CommandId, Event, EventBase, EventId, EventMetadata, GasCreditEvent, GasRefundedEvent, GatewayV2Message, MessageApprovedEvent, - MessageApprovedEventMetadata, MessageId, PublishEventsRequest, SignersRotatedEvent, + MessageApprovedEventMetadata, MessageExecutedEvent, MessageExecutedEventMetadata, + MessageExecutionStatus, MessageId, PublishEventsRequest, SignersRotatedEvent, SignersRotatedMetadata, Token, TxEvent, TxId, }; use relayer_amplifier_api_integration::AmplifierCommand; @@ -42,6 +43,7 @@ impl relayer_engine::RelayerComponent for SolanaEventForwarder { } } +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] enum GatewayOrGasEvent { GatewayEvent(GatewayEvent), GasEvent(GasServiceEvent), @@ -78,13 +80,22 @@ impl SolanaEventForwarder { #[tracing::instrument(skip_all, name = "Solana log forwarder")] pub(crate) async fn process_internal(mut self) -> eyre::Result<()> { - let match_context = MatchContext::new(self.config.gateway_program_id.to_string().as_str()); + let gateway_match_context = + MatchContext::new(self.config.gateway_program_id.to_string().as_str()); + let gas_service_match_context = + MatchContext::new(self.config.gas_service_program_id.to_string().as_str()); while let Some(message) = self.solana_listener_client.log_receiver.next().await { - let gateway_program_stack = - build_program_event_stack(&match_context, &message.logs, parse_gateway_logs); - let gas_events_program_stack = - build_program_event_stack(&match_context, &message.logs, parse_gas_service_log); + let gateway_program_stack = build_program_event_stack( + &gateway_match_context, + &message.logs, + parse_gateway_logs, + ); + let gas_events_program_stack = build_program_event_stack( + &gas_service_match_context, + &message.logs, + parse_gas_service_log, + ); // todo -- total cost is not representative let total_cost = message.cost_in_lamports; @@ -417,10 +428,45 @@ fn map_gateway_event_to_amplifier_event( )); tracing::info!("message approved"); } - GatewayAndGasEvent::MessageExecuted(ref _executed_message) => { - tracing::warn!( - "current gateway event does not produce enough artifacts to relay this message" - ); + GatewayAndGasEvent::MessageExecuted(executed_message) => { + let command_id = executed_message.command_id; + let span = tracing::info_span!("message", message_id = ?executed_message.cc_id_id); + let _g = span.enter(); + + let message_id = TxEvent(executed_message.cc_id_id); + gateway_event = Some(Event::MessageExecuted( + MessageExecutedEvent::builder() + .base( + EventBase::builder() + .event_id(event_id) + .meta(Some( + EventMetadata::builder() + .tx_id(Some(tx_id)) + .timestamp(message.timestamp) + .from_address(Some(executed_message.source_address.clone())) + .finalized(Some(true)) + .extra( + MessageExecutedEventMetadata::builder() + .command_id(Some(CommandId( + bs58::encode(command_id).into_string(), + ))) + .build(), + ) + .build(), + )) + .build(), + ) + .status(MessageExecutionStatus::Successful) + .source_chain(executed_message.source_address) + .message_id(message_id) + .cost( + Token::builder() + .amount(BigInt::from_u64(price_per_event_in_lamports)) + .build(), + ) + .build(), + )); + tracing::info!("message executed"); } GatewayAndGasEvent::NativeGasRefunded(event) => { let sig = Signature::from(event.tx_hash); @@ -516,3 +562,500 @@ fn construct_gas_event( .build(), ) } + +#[cfg(test)] +#[expect(clippy::unimplemented, reason = "needed for the test")] +#[expect(clippy::indexing_slicing, reason = "simpler code")] +mod tests { + use core::time::Duration; + use std::path::PathBuf; + + use axelar_solana_gateway_test_fixtures::base::TestFixture; + use axelar_solana_gateway_test_fixtures::gateway::make_verifiers_with_quorum; + use axelar_solana_gateway_test_fixtures::SolanaAxelarIntegrationMetadata; + use futures::{SinkExt as _, StreamExt as _}; + use pretty_assertions::assert_eq; + use relayer_amplifier_api_integration::amplifier_api::types::{ + BigInt, CallEvent, CallEventMetadata, Event, EventBase, EventMetadata, GasCreditEvent, + GatewayV2Message, PublishEventsRequest, Token, TxEvent, TxId, + }; + use relayer_amplifier_api_integration::{AmplifierCommand, AmplifierCommandClient}; + use solana_listener::{fetch_logs, SolanaListenerClient}; + use solana_rpc::rpc::JsonRpcConfig; + use solana_rpc::rpc_pubsub_service::PubSubConfig; + use solana_sdk::account::AccountSharedData; + use solana_sdk::commitment_config::CommitmentConfig; + use solana_sdk::pubkey::Pubkey; + use solana_sdk::signature::{Keypair, Signature}; + use solana_sdk::signer::Signer as _; + use solana_sdk::{bpf_loader_upgradeable, keccak, system_program}; + use solana_test_validator::UpgradeableProgramInfo; + + use crate::SolanaEventForwarder; + + #[test_log::test(tokio::test)] + async fn event_forwrding_only_call_contract() { + // setup + let config = crate::Config { + source_chain_name: "solana".to_owned(), + gateway_program_id: axelar_solana_gateway::id(), + gas_service_program_id: axelar_solana_gas_service::id(), + }; + let (tx_amplifier, mut rx_amplifier) = futures::channel::mpsc::unbounded(); + let (mut tx_listener, rx_listener) = futures::channel::mpsc::unbounded(); + let amplifier_client = AmplifierCommandClient { + sender: tx_amplifier, + }; + let solana_listener_client = SolanaListenerClient { + log_receiver: rx_listener, + }; + let event_forwarder = + SolanaEventForwarder::new(config, solana_listener_client, amplifier_client); + let _task = tokio::spawn(event_forwarder.process_internal()); + + let mut fixture = setup().await; + let (_gas_config, _gas_init_sig, counter_pda, _init_memo_sig) = + setup_aux_contracts(&mut fixture).await; + + // solana memo program to evm raw message + let payload = "msg memo only".to_owned(); + let payload_hash = keccak::hash(payload.as_bytes()).0; + let destination_chain = "evm".to_owned(); + let destination_contract = "0xdeadbeef".to_owned(); + let ix = axelar_solana_memo_program::instruction::call_gateway_with_memo( + &fixture.gateway_root_pda, + &counter_pda.0, + payload.clone(), + destination_chain.clone(), + destination_contract.clone(), + &axelar_solana_gateway::id(), + ) + .unwrap(); + let only_call_contract_sig = fixture.send_tx_with_signatures(&[ix]).await.unwrap().0[0]; + + let rpc_client_url = match fixture.fixture.test_node { + axelar_solana_gateway_test_fixtures::base::TestNodeMode::TestValidator { + ref validator, + .. + } => validator.rpc_url(), + axelar_solana_gateway_test_fixtures::base::TestNodeMode::ProgramTest { .. } => { + unimplemented!() + } + }; + let rpc_client = + retrying_solana_http_sender::new_client(&retrying_solana_http_sender::Config { + max_concurrent_rpc_requests: 1, + solana_http_rpc: rpc_client_url.parse().unwrap(), + commitment: CommitmentConfig::confirmed(), + }); + let tx = fetch_logs( + CommitmentConfig::confirmed(), + only_call_contract_sig, + &rpc_client, + ) + .await + .unwrap(); + tx_listener.send(tx.clone()).await.unwrap(); + let item = rx_amplifier.next().await.unwrap(); + let event_id = TxEvent::new(only_call_contract_sig.to_string().as_str(), 5); + let expected_event = CallEvent { + base: EventBase { + event_id: event_id.clone(), + meta: Some(EventMetadata { + tx_id: Some(TxId(only_call_contract_sig.to_string())), + timestamp: tx.timestamp, + from_address: Some(counter_pda.0.to_string()), + finalized: Some(true), + extra: CallEventMetadata { + parent_message_id: None, + }, + }), + }, + message: GatewayV2Message { + message_id: event_id, + source_chain: "solana".to_owned(), + source_address: counter_pda.0.to_string(), + destination_address: destination_contract.clone(), + payload_hash: payload_hash.to_vec(), + }, + destination_chain, + payload: payload.into_bytes(), + }; + + assert_eq!( + item, + AmplifierCommand::PublishEvents( + PublishEventsRequest::builder() + .events(vec![Event::Call(expected_event)]) + .build() + ) + ); + } + + #[test_log::test(tokio::test)] + async fn event_forwrding_only_gas_event() { + // setup + let config = crate::Config { + source_chain_name: "solana".to_owned(), + gateway_program_id: axelar_solana_gateway::id(), + gas_service_program_id: axelar_solana_gas_service::id(), + }; + let (tx_amplifier, mut rx_amplifier) = futures::channel::mpsc::unbounded(); + let (mut tx_listener, rx_listener) = futures::channel::mpsc::unbounded(); + let amplifier_client = AmplifierCommandClient { + sender: tx_amplifier, + }; + let solana_listener_client = SolanaListenerClient { + log_receiver: rx_listener, + }; + let event_forwarder = + SolanaEventForwarder::new(config, solana_listener_client, amplifier_client); + let _task = tokio::spawn(event_forwarder.process_internal()); + + let mut fixture = setup().await; + let (gas_config, _gas_init_sig, _counter_pda, _init_memo_sig) = + setup_aux_contracts(&mut fixture).await; + + // solana memo program to evm raw message + let signature_to_fund = [111; 64]; + let idx_to_fund = 123; + let refund_address = Pubkey::new_unique(); + let amount_to_refund = 5000; + let gas_ix = axelar_solana_gas_service::instructions::add_native_gas_instruction( + &axelar_solana_gas_service::id(), + &fixture.payer.pubkey(), + &gas_config.config_pda, + signature_to_fund, + idx_to_fund, + amount_to_refund, + refund_address, + ) + .unwrap(); + let only_gas_add_sig = *fixture + .send_tx_with_signatures(&[gas_ix]) + .await + .unwrap() + .0 + .first() + .unwrap(); + + let rpc_client_url = match fixture.fixture.test_node { + axelar_solana_gateway_test_fixtures::base::TestNodeMode::TestValidator { + ref validator, + .. + } => validator.rpc_url(), + axelar_solana_gateway_test_fixtures::base::TestNodeMode::ProgramTest { .. } => { + unimplemented!() + } + }; + let rpc_client = + retrying_solana_http_sender::new_client(&retrying_solana_http_sender::Config { + max_concurrent_rpc_requests: 1, + solana_http_rpc: rpc_client_url.parse().unwrap(), + commitment: CommitmentConfig::confirmed(), + }); + let tx = fetch_logs(CommitmentConfig::confirmed(), only_gas_add_sig, &rpc_client) + .await + .unwrap(); + tx_listener.send(tx.clone()).await.unwrap(); + let item = rx_amplifier.next().await.unwrap(); + let event_id = TxEvent::new(only_gas_add_sig.to_string().as_str(), 3); + let message_id_to_fund = TxEvent::new( + Signature::from(signature_to_fund).to_string().as_str(), + idx_to_fund.try_into().unwrap(), + ); + let expected_event = GasCreditEvent { + base: EventBase { + event_id, + meta: Some(EventMetadata { + tx_id: Some(TxId(only_gas_add_sig.to_string())), + timestamp: tx.timestamp, + from_address: None, + finalized: Some(true), + extra: (), + }), + }, + message_id: message_id_to_fund, + refund_address: refund_address.to_string(), + payment: Token { + token_id: None, + amount: BigInt::from_u64(amount_to_refund), + }, + }; + + assert_eq!( + item, + AmplifierCommand::PublishEvents( + PublishEventsRequest::builder() + .events(vec![Event::GasCredit(expected_event)]) + .build() + ) + ); + } + + #[test_log::test(tokio::test)] + async fn event_forwrding_with_gas_and_contract_call() { + // setup + let config = crate::Config { + source_chain_name: "solana".to_owned(), + gateway_program_id: axelar_solana_gateway::id(), + gas_service_program_id: axelar_solana_gas_service::id(), + }; + let (tx_amplifier, mut rx_amplifier) = futures::channel::mpsc::unbounded(); + let (mut tx_listener, rx_listener) = futures::channel::mpsc::unbounded(); + let amplifier_client = AmplifierCommandClient { + sender: tx_amplifier, + }; + let solana_listener_client = SolanaListenerClient { + log_receiver: rx_listener, + }; + let event_forwarder = + SolanaEventForwarder::new(config, solana_listener_client, amplifier_client); + let _task = tokio::spawn(event_forwarder.process_internal()); + + let mut fixture = setup().await; + let (gas_config, _gas_init_sig, counter_pda, _init_memo_sig) = + setup_aux_contracts(&mut fixture).await; + + let payload = "msg memo and gas".to_owned(); + let destination_chain_name = "evm".to_owned(); + let payload_hash = solana_sdk::keccak::hashv(&[payload.as_bytes()]).0; + let destination_address = "0xdeadbeef".to_owned(); + let ix = axelar_solana_memo_program::instruction::call_gateway_with_memo( + &fixture.gateway_root_pda, + &counter_pda.0, + payload.clone(), + destination_chain_name.clone(), + destination_address.clone(), + &axelar_solana_gateway::id(), + ) + .unwrap(); + let refund_address = Pubkey::new_unique(); + let gas_fee_amount = 5000; + let gas_ix = + axelar_solana_gas_service::instructions::pay_native_for_contract_call_instruction( + &axelar_solana_gas_service::id(), + &fixture.payer.pubkey(), + &gas_config.config_pda, + destination_chain_name.clone(), + destination_address.clone(), + payload_hash, + refund_address, + vec![], + gas_fee_amount, + ) + .unwrap(); + let gas_and_call_contract_sig = fixture + .send_tx_with_signatures(&[gas_ix, ix]) + .await + .unwrap() + .0[0]; + + let rpc_client_url = match fixture.fixture.test_node { + axelar_solana_gateway_test_fixtures::base::TestNodeMode::TestValidator { + ref validator, + .. + } => validator.rpc_url(), + axelar_solana_gateway_test_fixtures::base::TestNodeMode::ProgramTest { .. } => { + unimplemented!() + } + }; + let rpc_client = + retrying_solana_http_sender::new_client(&retrying_solana_http_sender::Config { + max_concurrent_rpc_requests: 1, + solana_http_rpc: rpc_client_url.parse().unwrap(), + commitment: CommitmentConfig::confirmed(), + }); + let tx = fetch_logs( + CommitmentConfig::confirmed(), + gas_and_call_contract_sig, + &rpc_client, + ) + .await + .unwrap(); + tx_listener.send(tx.clone()).await.unwrap(); + let item = rx_amplifier.next().await.unwrap(); + let event_id = TxEvent::new(gas_and_call_contract_sig.to_string().as_str(), 11); + let expected_call_event = CallEvent { + base: EventBase { + event_id: event_id.clone(), + meta: Some(EventMetadata { + tx_id: Some(TxId(gas_and_call_contract_sig.to_string())), + timestamp: tx.timestamp, + from_address: Some(counter_pda.0.to_string()), + finalized: Some(true), + extra: CallEventMetadata { + parent_message_id: None, + }, + }), + }, + message: GatewayV2Message { + message_id: event_id.clone(), + source_chain: "solana".to_owned(), + source_address: counter_pda.0.to_string(), + destination_address: destination_address.clone(), + payload_hash: payload_hash.to_vec(), + }, + destination_chain: destination_chain_name.clone(), + payload: payload.into_bytes(), + }; + let expected_gas_event = GasCreditEvent { + base: EventBase { + event_id: event_id.clone(), + meta: Some(EventMetadata { + tx_id: Some(TxId(gas_and_call_contract_sig.to_string())), + timestamp: tx.timestamp, + from_address: None, + finalized: Some(true), + extra: (), + }), + }, + message_id: event_id, + refund_address: refund_address.to_string(), + payment: Token { + token_id: None, + amount: BigInt::from_u64(gas_fee_amount), + }, + }; + + assert_eq!( + item, + AmplifierCommand::PublishEvents( + PublishEventsRequest::builder() + .events(vec![ + Event::Call(expected_call_event), + Event::GasCredit(expected_gas_event) + ]) + .build() + ) + ); + } + + pub(crate) async fn setup_aux_contracts( + fixture: &mut SolanaAxelarIntegrationMetadata, + ) -> ( + axelar_solana_gateway_test_fixtures::gas_service::GasServiceUtils, + Signature, + (Pubkey, u8), + Signature, + ) { + // init gas config + let gas_service_upgr_auth = fixture.payer.insecure_clone(); + let gas_config = fixture.setup_default_gas_config(gas_service_upgr_auth); + let ix = axelar_solana_gas_service::instructions::init_config( + &axelar_solana_gas_service::ID, + &fixture.payer.pubkey(), + &gas_config.config_authority.pubkey(), + &gas_config.config_pda, + gas_config.salt, + ) + .unwrap(); + let gas_init_sig = *fixture + .send_tx_with_signatures(&[ix]) + .await + .unwrap() + .0 + .first() + .unwrap(); + + // init memo program + let counter_pda = axelar_solana_memo_program::get_counter_pda(&fixture.gateway_root_pda); + let ix = axelar_solana_memo_program::instruction::initialize( + &fixture.payer.pubkey(), + &fixture.gateway_root_pda, + &counter_pda, + ) + .unwrap(); + let init_memo_sig = fixture.send_tx_with_signatures(&[ix]).await.unwrap().0[0]; + (gas_config, gas_init_sig, counter_pda, init_memo_sig) + } + + /// Return the [`PathBuf`] that points to the `[repo]` folder + #[must_use] + pub(crate) fn workspace_root_dir() -> PathBuf { + let dir = std::env::var("CARGO_MANIFEST_DIR") + .unwrap_or_else(|_| env!("CARGO_MANIFEST_DIR").to_owned()); + PathBuf::from(dir) + .parent() + .unwrap() + .parent() + .unwrap() + .to_owned() + } + + pub(crate) async fn setup() -> SolanaAxelarIntegrationMetadata { + use solana_test_validator::TestValidatorGenesis; + let mut validator = TestValidatorGenesis::default(); + + let mut rpc_config = JsonRpcConfig::default_for_test(); + rpc_config.enable_rpc_transaction_history = true; + rpc_config.enable_extended_tx_metadata_storage = true; + validator.rpc_config(rpc_config); + + let mut pubsub_config = PubSubConfig::default_for_tests(); + pubsub_config.enable_block_subscription = true; + validator.pubsub_config(pubsub_config); + + let upgrade_authority = Keypair::new(); + validator.add_account( + upgrade_authority.pubkey(), + AccountSharedData::new(u64::MAX, 0, &system_program::ID), + ); + validator.add_upgradeable_programs_with_path(&[ + UpgradeableProgramInfo { + program_id: axelar_solana_gateway::id(), + loader: bpf_loader_upgradeable::id(), + upgrade_authority: upgrade_authority.pubkey(), + program_path: workspace_root_dir() + .join("tests") + .join("fixtures") + .join("axelar_solana_gateway.so"), + }, + UpgradeableProgramInfo { + program_id: axelar_solana_gas_service::id(), + loader: bpf_loader_upgradeable::id(), + upgrade_authority: upgrade_authority.pubkey(), + program_path: workspace_root_dir() + .join("tests") + .join("fixtures") + .join("axelar_solana_gas_service.so"), + }, + UpgradeableProgramInfo { + program_id: axelar_solana_memo_program::id(), + loader: bpf_loader_upgradeable::id(), + upgrade_authority: upgrade_authority.pubkey(), + program_path: workspace_root_dir() + .join("tests") + .join("fixtures") + .join("axelar_solana_memo_program.so"), + }, + ]); + + let forced_sleep = if std::env::var("CI").is_ok() { + Duration::from_millis(1500) + } else { + Duration::from_millis(500) + }; + let mut fixture = TestFixture::new_test_validator(validator, forced_sleep).await; + let init_payer = fixture.payer.insecure_clone(); + fixture.payer = upgrade_authority.insecure_clone(); + + let operator = Keypair::new(); + let domain_separator = [42; 32]; + let initial_signers = make_verifiers_with_quorum(&[42], 0, 42, domain_separator); + let mut fixture = SolanaAxelarIntegrationMetadata { + domain_separator, + upgrade_authority, + fixture, + signers: initial_signers, + gateway_root_pda: axelar_solana_gateway::get_gateway_root_config_pda().0, + operator, + previous_signers_retention: 16, + minimum_rotate_signers_delay_seconds: 1, + }; + + fixture.initialize_gateway_config_account().await.unwrap(); + fixture.payer = init_payer; + fixture + } +} diff --git a/crates/solana-event-forwarder/src/config.rs b/crates/solana-event-forwarder/src/config.rs index ab4f912..0d64cdf 100644 --- a/crates/solana-event-forwarder/src/config.rs +++ b/crates/solana-event-forwarder/src/config.rs @@ -11,6 +11,8 @@ pub struct Config { pub source_chain_name: String, /// The Solana gateway program id. pub gateway_program_id: Pubkey, + /// The gas service program id + pub gas_service_program_id: Pubkey, } impl Config { @@ -19,11 +21,13 @@ impl Config { #[must_use] pub fn new( sol_listener_cfg: &solana_listener::Config, + solana_task_processor: &solana_gateway_task_processor::Config, amplifier_cfg: &relayer_amplifier_api_integration::Config, ) -> Self { Self { source_chain_name: amplifier_cfg.chain.clone(), gateway_program_id: sol_listener_cfg.gateway_program_address, + gas_service_program_id: solana_task_processor.gas_service_program_address, } } } diff --git a/crates/solana-gateway-task-processor/src/component.rs b/crates/solana-gateway-task-processor/src/component.rs index 31c45b9..646f794 100644 --- a/crates/solana-gateway-task-processor/src/component.rs +++ b/crates/solana-gateway-task-processor/src/component.rs @@ -17,7 +17,7 @@ use axelar_solana_encoding::borsh::BorshDeserialize as _; use axelar_solana_encoding::types::execute_data::{ExecuteData, MerkleisedPayload}; use axelar_solana_encoding::types::messages::{CrossChainId, Message}; use axelar_solana_gateway::error::GatewayError; -use axelar_solana_gateway::state::incoming_message::{command_id, IncomingMessage, MessageStatus}; +use axelar_solana_gateway::state::incoming_message::{command_id, IncomingMessage}; use axelar_solana_gateway::BytemuckedPda as _; use effective_tx_sender::ComputeBudgetError; use eyre::{Context as _, OptionExt as _}; @@ -155,6 +155,7 @@ impl SolanaTxPusher { gateway_root_pda, name_of_the_solana_chain: self.name_on_amplifier.clone(), gas_service_config_pda: self.config.gas_service_config_pda, + gas_service_program_id: self.config.gas_service_program_address, } } } @@ -164,10 +165,15 @@ async fn ensure_gas_service_authority( solana_rpc_client: &RpcClient, metadata: &ConfigMetadata, ) -> eyre::Result<()> { - let account_data = solana_rpc_client - .get_account_data(&metadata.gas_service_config_pda) + let account = solana_rpc_client + .get_account(&metadata.gas_service_config_pda) .await?; - let config = axelar_solana_gas_service::state::Config::read(&account_data) + if account.owner != metadata.gas_service_program_id { + eyre::bail!( + "gas service program id is not the owner of the provided gas service config PDA" + ) + } + let config = axelar_solana_gas_service::state::Config::read(&account.data) .ok_or_eyre("gas service config PDA account not initialized")?; if config.authority != *key { @@ -181,6 +187,7 @@ struct ConfigMetadata { name_of_the_solana_chain: String, gateway_root_pda: Pubkey, gas_service_config_pda: Pubkey, + gas_service_program_id: Pubkey, } #[instrument(skip_all)] @@ -444,7 +451,7 @@ async fn incoming_message_already_executed( let incoming_message = IncomingMessage::read(&raw_incoming_message) .ok_or_eyre("failed to read incoming message")?; - Ok(incoming_message.status == MessageStatus::Executed) + Ok(incoming_message.status.is_executed()) } /// Validates that the relayer's signing account is not included in the transaction payload. @@ -581,7 +588,7 @@ async fn refund_task( eyre::bail!("non-native token refunds are not supported"); } else { let instruction = axelar_solana_gas_service::instructions::refund_native_fees_instruction( - &axelar_solana_gas_service::id(), + &metadata.gas_service_program_id, &keypair.pubkey(), &receiver, &metadata.gas_service_config_pda, diff --git a/crates/solana-gateway-task-processor/src/config.rs b/crates/solana-gateway-task-processor/src/config.rs index 88e0db2..f302272 100644 --- a/crates/solana-gateway-task-processor/src/config.rs +++ b/crates/solana-gateway-task-processor/src/config.rs @@ -12,6 +12,12 @@ pub struct Config { #[serde(default = "config_defaults::gateway_program_address")] pub gateway_program_address: Pubkey, + /// Gas service program id + #[serde(deserialize_with = "common_serde_utils::pubkey_decode")] + #[builder(default = config_defaults::gas_service_program_address())] + #[serde(default = "config_defaults::gas_service_program_address")] + pub gas_service_program_address: Pubkey, + /// The PDA used to store the gas service configuration associated with this relayer instance. #[serde(deserialize_with = "common_serde_utils::pubkey_decode")] pub gas_service_config_pda: Pubkey, @@ -28,6 +34,10 @@ pub(crate) mod config_defaults { pub(crate) const fn gateway_program_address() -> Pubkey { axelar_solana_gateway::id() } + + pub(crate) const fn gas_service_program_address() -> Pubkey { + axelar_solana_gas_service::id() + } } #[expect(clippy::min_ident_chars, reason = "part of trait definitions")] diff --git a/deny.toml b/deny.toml index 876be4c..08220af 100644 --- a/deny.toml +++ b/deny.toml @@ -115,7 +115,7 @@ allow = [ # The higher the value, the more closely the license text must be to the # canonical license text of a valid SPDX license file. # [possible values: any between 0.0 and 1.0]. -confidence-threshold = 0.8 +confidence-threshold = 0.6 # Allow 1 or more licenses on a per-crate basis, so that particular licenses # aren't accepted for every possible crate as with the normal allow list exceptions = [ diff --git a/tests/fixtures/axelar_solana_gateway.so b/tests/fixtures/axelar_solana_gateway.so index df319a5..59fd83c 100755 Binary files a/tests/fixtures/axelar_solana_gateway.so and b/tests/fixtures/axelar_solana_gateway.so differ diff --git a/tests/fixtures/axelar_solana_memo_program.so b/tests/fixtures/axelar_solana_memo_program.so index 23a5be5..dff0034 100755 Binary files a/tests/fixtures/axelar_solana_memo_program.so and b/tests/fixtures/axelar_solana_memo_program.so differ