Skip to content

Commit

Permalink
feat(task-processor): add ITS message handling (#5)
Browse files Browse the repository at this point in the history
* feat(task-processor): add ITS message handling

ITS messages, just like governance ones are somewhat special and need
separate logic to handle them.

Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>

* fix(deny): ignore its-instruction-builder license

Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>

---------

Signed-off-by: Guilherme Felipe da Silva <gfsilva.eng@gmail.com>
  • Loading branch information
frenzox authored Dec 13, 2024
1 parent ca28104 commit 9d9666c
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 23 deletions.
58 changes: 44 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,14 @@ relayer-amplifier-state = { git = "https://github.com/eigerco/axelar-relayer-cor
core-common-serde-utils = { git = "https://github.com/eigerco/axelar-relayer-core.git", package = "common-serde-utils", branch = "main" }

# Solana Gateway
axelar-solana-gateway = { git = "https://github.com/eigerco/solana-axelar.git", rev = "e212e33", features = ["no-entrypoint"] }
axelar-solana-its = { git = "https://github.com/eigerco/solana-axelar.git", rev = "e212e33", features = ["no-entrypoint"] }
axelar-solana-governance = { git = "https://github.com/eigerco/solana-axelar.git", rev = "e212e33", features = ["no-entrypoint"] }
gateway-event-stack = { git = "https://github.com/eigerco/solana-axelar.git", rev = "e212e33" }
axelar-solana-encoding = { git = "https://github.com/eigerco/solana-axelar.git", rev = "e212e33" }
axelar-message-primitives = { git = "https://github.com/eigerco/solana-axelar.git", rev = "e212e33" }
axelar-executable = { git = "https://github.com/eigerco/solana-axelar.git", rev = "e212e33" }
axelar-solana-gateway = { git = "https://github.com/eigerco/solana-axelar.git", rev = "f065eda", features = ["no-entrypoint"] }
axelar-solana-its = { git = "https://github.com/eigerco/solana-axelar.git", rev = "f065eda", features = ["no-entrypoint"] }
axelar-solana-governance = { git = "https://github.com/eigerco/solana-axelar.git", rev = "f065eda", features = ["no-entrypoint"] }
gateway-event-stack = { git = "https://github.com/eigerco/solana-axelar.git", rev = "f065eda" }
axelar-solana-encoding = { git = "https://github.com/eigerco/solana-axelar.git", rev = "f065eda" }
axelar-message-primitives = { git = "https://github.com/eigerco/solana-axelar.git", rev = "f065eda" }
axelar-executable = { git = "https://github.com/eigerco/solana-axelar.git", rev = "f065eda" }
its-instruction-builder = { git = "https://github.com/eigerco/solana-axelar.git", rev = "f065eda" }

# CLI
clap = { version = "4", features = ["derive"] }
Expand Down
1 change: 1 addition & 0 deletions crates/solana-gateway-task-processor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ effective-tx-sender.workspace = true
axelar-executable.workspace = true
num-traits.workspace = true
relayer-amplifier-state.workspace = true
its-instruction-builder.workspace = true

[dev-dependencies]
serde_json.workspace = true
Expand Down
12 changes: 10 additions & 2 deletions crates/solana-gateway-task-processor/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,16 @@ async fn execute_task(
let destination_address = message.destination_address.parse::<Pubkey>()?;
match destination_address {
axelar_solana_its::ID => {
// todo ITS specific handling
tracing::error!("ITS program not yet supported");
let ix = its_instruction_builder::build_its_gmp_instruction(
signer,
gateway_incoming_message_pda,
message,
payload,
solana_rpc_client,
)
.await?;

send_tx(solana_rpc_client, keypair, ix).await?;
}
axelar_solana_governance::ID => {
// todo Governance specific handling
Expand Down
4 changes: 4 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ license-files = []
crate = "axelar-executable"
expression = "MIT"
license-files = []
[[licenses.clarify]]
crate = "its-instruction-builder"
expression = "MIT"
license-files = []

[[licenses.clarify]]
# The package spec the clarification applies to
Expand Down

0 comments on commit 9d9666c

Please sign in to comment.