diff --git a/rust/abacus-base/src/contract_sync/mailbox.rs b/rust/abacus-base/src/contract_sync/mailbox.rs index 4bf0a772e..6f2496b3f 100644 --- a/rust/abacus-base/src/contract_sync/mailbox.rs +++ b/rust/abacus-base/src/contract_sync/mailbox.rs @@ -2,8 +2,7 @@ use tracing::{debug, info, info_span, warn}; use tracing::{instrument::Instrumented, Instrument}; use abacus_core::{ - name_from_domain_id, CommittedMessage, Indexer, ListValidity, OutboxIndexer, - SyncBlockRangeCursor, + name_from_domain_id, Indexer, ListValidity, MailboxIndexer, SyncBlockRangeCursor, }; use crate::contract_sync::last_message::validate_message_continuity; @@ -16,7 +15,9 @@ where I: MailboxIndexer + Clone + 'static, { /// Sync dispatched messages - pub fn sync_dispatched_messages(&self) -> Instrumented>> { + pub fn sync_dispatched_messages( + &self, + ) -> Instrumented>> { let span = info_span!("MessageContractSync"); let db = self.db.clone(); @@ -238,11 +239,13 @@ mod test { use tokio::time::{interval, sleep, timeout}; use abacus_core::{db::AbacusDB, AbacusMessage, LogMeta}; + use abacus_test::mocks::cursor::MockSyncBlockRangeCursor; use abacus_test::mocks::indexer::MockAbacusIndexer; use abacus_test::test_utils; use crate::contract_sync::mailbox::MOCK_CURSOR; use crate::contract_sync::schema::OutboxContractSyncDB; + use crate::contract_sync::IndexSettings; use crate::ContractSync; use crate::{ContractSyncMetrics, CoreMetrics}; @@ -267,6 +270,12 @@ mod test { }; let messages = (0..10).map(message_gen).collect::>(); + let m0 = messages[0].clone(); + let m1 = messages[1].clone(); + let m2 = messages[2].clone(); + let m3 = messages[3].clone(); + let m4 = messages[4].clone(); + let m5 = messages[5].clone(); let meta = || LogMeta { address: Default::default(), @@ -306,7 +315,7 @@ mod test { } macro_rules! expect_fetches_range { ($expected_from:literal, $expected_to:literal, $return_messages:expr) => { - let messages: &[&RawCommittedMessage] = $return_messages; + let messages: &[&AbacusMessage] = $return_messages; let messages = messages.iter().map(|&msg| (msg.clone(), meta())).collect(); mock_cursor .expect__next_range() diff --git a/rust/abacus-core/src/traits/mod.rs b/rust/abacus-core/src/traits/mod.rs index d3dc46650..7e0b71cb6 100644 --- a/rust/abacus-core/src/traits/mod.rs +++ b/rust/abacus-core/src/traits/mod.rs @@ -10,7 +10,6 @@ use ethers::{ providers::{Middleware, ProviderError}, }; -pub use common::*; pub use cursor::*; pub use encode::*; pub use indexer::*; @@ -21,7 +20,6 @@ pub use provider::*; use crate::{db::DbError, AbacusError}; -mod common; mod cursor; mod encode; mod indexer; diff --git a/rust/agents/scraper/src/chain_scraper/sync.rs b/rust/agents/scraper/src/chain_scraper/sync.rs index 737238de5..a99412256 100644 --- a/rust/agents/scraper/src/chain_scraper/sync.rs +++ b/rust/agents/scraper/src/chain_scraper/sync.rs @@ -10,9 +10,7 @@ use prometheus::{IntCounter, IntGauge, IntGaugeVec}; use tracing::{debug, info, instrument, warn}; use abacus_base::last_message::validate_message_continuity; -use abacus_core::{ - name_from_domain_id, CommittedMessage, ListValidity, OutboxIndexer, SyncBlockRangeCursor, -}; +use abacus_core::{name_from_domain_id, ListValidity, MailboxIndexer, SyncBlockRangeCursor}; use crate::chain_scraper::{AbacusMessageWithMeta, Delivery, SqlChainScraper, TxnWithIdAndTime}; @@ -32,7 +30,7 @@ pub(super) struct Syncer { stored_deliveries: IntCounter, missed_messages: IntCounter, message_nonce: IntGaugeVec, - sync_cursor: RateLimitedSyncBlockRangeCursor>, + sync_cursor: RateLimitedSyncBlockRangeCursor>, last_valid_range_start_block: u32, last_nonce: u32, @@ -85,7 +83,7 @@ impl Syncer { let last_nonce = scraper.last_message_nonce().await?.unwrap_or(0); let sync_cursor = RateLimitedSyncBlockRangeCursor::new( - scraper.local.indexer.clone(), + scraper.contracts.indexer.clone(), chunk_size, initial_height, ) @@ -114,7 +112,6 @@ impl Syncer { self.indexed_deliveries_height.set(start_block as i64); loop { - debug_assert_eq!(self.local.outbox.local_domain(), self.local_domain()); let start_block = self.sync_cursor.current_position(); let (from, to) = match self.sync_cursor.next_range().await { Ok(range) => range, diff --git a/solidity/contracts/middleware/InterchainAccountRouter.sol b/solidity/contracts/middleware/InterchainAccountRouter.sol index 73f2a3067..f99b3ab32 100644 --- a/solidity/contracts/middleware/InterchainAccountRouter.sol +++ b/solidity/contracts/middleware/InterchainAccountRouter.sol @@ -49,7 +49,7 @@ contract InterchainAccountRouter is Router, IInterchainAccountRouter { uint32 _destinationDomain, address target, bytes calldata data - ) external returns (uint256) { + ) external returns (bytes32) { Call[] memory calls = new Call[](1); calls[0] = Call({to: target, data: data}); return _dispatch(_destinationDomain, abi.encode(msg.sender, calls)); diff --git a/solidity/contracts/middleware/InterchainQueryRouter.sol b/solidity/contracts/middleware/InterchainQueryRouter.sol index c16ea41b4..cbb010c08 100644 --- a/solidity/contracts/middleware/InterchainQueryRouter.sol +++ b/solidity/contracts/middleware/InterchainQueryRouter.sol @@ -55,13 +55,13 @@ contract InterchainQueryRouter is address target, bytes calldata queryData, bytes calldata callback - ) external returns (uint256 leafIndex) { + ) external returns (bytes32 messageId) { // TODO: fix this ugly arrayification Call[] memory calls = new Call[](1); calls[0] = Call({to: target, data: queryData}); bytes[] memory callbacks = new bytes[](1); callbacks[0] = callback; - leafIndex = query(_destinationDomain, calls, callbacks); + messageId = query(_destinationDomain, calls, callbacks); } /** diff --git a/solidity/interfaces/IInterchainAccountRouter.sol b/solidity/interfaces/IInterchainAccountRouter.sol index 11fcd3024..db619205b 100644 --- a/solidity/interfaces/IInterchainAccountRouter.sol +++ b/solidity/interfaces/IInterchainAccountRouter.sol @@ -12,7 +12,7 @@ interface IInterchainAccountRouter { uint32 _destinationDomain, address target, bytes calldata data - ) external returns (uint256); + ) external returns (bytes32); function getInterchainAccount(uint32 _originDomain, address _sender) external diff --git a/solidity/interfaces/IInterchainQueryRouter.sol b/solidity/interfaces/IInterchainQueryRouter.sol index b398a716e..315fc85e7 100644 --- a/solidity/interfaces/IInterchainQueryRouter.sol +++ b/solidity/interfaces/IInterchainQueryRouter.sol @@ -9,7 +9,7 @@ interface IInterchainQueryRouter { address target, bytes calldata queryData, bytes calldata callback - ) external returns (uint256); + ) external returns (bytes32); function query( uint32 _destinationDomain,