diff --git a/crates/relayer/src/chain/axon.rs b/crates/relayer/src/chain/axon.rs index fecd840a2..029e0b388 100644 --- a/crates/relayer/src/chain/axon.rs +++ b/crates/relayer/src/chain/axon.rs @@ -1388,8 +1388,32 @@ impl AxonChain { Ok(e) => return Ok(e), Err(e) => { if e.to_string().contains("reverted: getHeader") { - std::thread::sleep(Duration::from_secs(5)); - tracing::info!("getHeader failed, waiting for header sync"); + #[cfg(not(test))] + { + let output = std::process::Command::new("curl") + .arg("-H") + .arg("content-type: application/json") + .arg("-d") + .arg("{\"id\": 2, \"jsonrpc\": \"2.0\", \"method\": \"info\", \"params\": [] }") + .arg(self.config.cell_emitter_addr.to_string()) + .output() + .unwrap(); + let log = if output.status.success() { + output.stdout + } else { + output.stderr + }; + tracing::warn!( + "getHeader failed, waiting for header sync: {}", + String::from_utf8(log).unwrap() + ); + std::thread::sleep(Duration::from_secs(60)); + } + #[cfg(test)] + { + tracing::warn!("getHeader failed, waiting for header sync"); + std::thread::sleep(Duration::from_secs(5)); + } continue; } return Err(e); diff --git a/crates/relayer/src/config/axon.rs b/crates/relayer/src/config/axon.rs index 413b55906..5916e47bd 100644 --- a/crates/relayer/src/config/axon.rs +++ b/crates/relayer/src/config/axon.rs @@ -10,6 +10,7 @@ pub struct AxonChainConfig { pub id: ChainId, pub websocket_addr: WebSocketClientUrl, pub rpc_addr: Url, + pub cell_emitter_addr: Url, pub contract_address: ethers::types::Address, pub transfer_contract_address: ethers::types::Address, pub restore_block_count: u64, diff --git a/crates/relayer/tests/config/fixtures/relayer_conf_example.toml b/crates/relayer/tests/config/fixtures/relayer_conf_example.toml index de46b89da..986839d9f 100644 --- a/crates/relayer/tests/config/fixtures/relayer_conf_example.toml +++ b/crates/relayer/tests/config/fixtures/relayer_conf_example.toml @@ -89,6 +89,7 @@ client_type_args = { cells_count = 4, type_id = "0x673e557da4c8381638fc808956aa2 id = 'axon-0' websocket_addr = "ws://127.0.0.1:8010" rpc_addr = "http://127.0.0.1:8000/" +cell_emitter_addr = "http://127.0.0.1:8001/" contract_address = "0x15Ff10fCc8A1a50bFbE07847A22664801eA79E0f" transfer_contract_address = "0x0000000000000000000000000000000000000000" restore_block_count = 10000 diff --git a/e2e/schedule/sdk.config.toml b/e2e/schedule/sdk.config.toml index a292bac13..e9fb48a16 100644 --- a/e2e/schedule/sdk.config.toml +++ b/e2e/schedule/sdk.config.toml @@ -1,6 +1,6 @@ channel_contract_type_id_args = "0x4d63d2d59c9f8e2b117cde09bb3d705b82e0e21216a3cc54967e715bf19a25b8" packet_contract_type_id_args = "0x7e2f534bf12a8f596411ca8c02f698b8cdc3581e851325b4fbb7580b1f20e289" -axon_ibc_handler_address = "0xd6e1afe5cA8D00A2EFC01B89997abE2De47fdfAf" +axon_ibc_handler_address = "0xde2Bd2ffEA002b8E84ADeA96e5976aF664115E2c" channel_id = 0 confirmations = 3 diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index 70c001446..2f28efa65 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -238,6 +238,7 @@ impl FullNode { packet_filter: Default::default(), websocket_addr, rpc_addr, + cell_emitter_addr: Url::from_str("http://127.0.0.1").unwrap(), // set it as normal in test contract_address, transfer_contract_address, restore_block_count,