Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Movement Client and Relayer Code Update for Native Bridge #893

Merged
merged 21 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
274 changes: 139 additions & 135 deletions Cargo.lock

Large diffs are not rendered by default.

65 changes: 33 additions & 32 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,40 +122,40 @@ serde_yaml = "0.9.34"
## Aptos dependencies
### We use a forked version so that we can override dependency versions. This is required
### to be avoid dependency conflicts with other Sovereign Labs crates.
aptos-api = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-api-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-bitvec = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-block-executor = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-cached-packages = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-config = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-consensus-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-crypto = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41", features = [
aptos-api = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-api-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-bitvec = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-block-executor = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-cached-packages = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-config = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-consensus-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-crypto = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef", features = [
"cloneable-private-keys",
] }
aptos-db = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-executor = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-executor-test-helpers = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-executor-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-faucet-core = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-framework = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-language-e2e-tests = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-mempool = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-proptest-helpers = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-sdk = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-state-view = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-storage-interface = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-temppath = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-vm = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-vm-genesis = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-vm-logging = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-vm-validator = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-logger = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-vm-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-indexer = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-indexer-grpc-fullnode = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-indexer-grpc-table-info = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-protos = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "9dfc8e7a3d622597dfd81cc4ba480a5377f87a41" }
aptos-db = { git = "https://github.com/movementlabsxyz/aptos-core.git", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-executor = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-executor-test-helpers = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-executor-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-faucet-core = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-framework = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-language-e2e-tests = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-mempool = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-proptest-helpers = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-sdk = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-state-view = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-storage-interface = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-temppath = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-vm = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-vm-genesis = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-vm-logging = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-vm-validator = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-logger = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-vm-types = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-indexer = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-indexer-grpc-fullnode = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-indexer-grpc-table-info = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }
aptos-protos = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "111a5540e5def0b17851cc4a9e2f46955efcf1ef" }

# Indexer
processor = { git = "https://github.com/movementlabsxyz/aptos-indexer-processors", rev = "7658338eb9224abd9698c1e02dbc6ca526c268ce" }
Expand All @@ -169,6 +169,7 @@ ethers-contract = "=2.0.10"
ethers-providers = { version = "=2.0.10", default-features = false }
ethers-signers = { version = "=2.0.10", default-features = false }
ethers-middleware = { version = "=2.0.10", default-features = false }
ethabi = "18.0.0"
move-binary-format = { git = "https://github.com/diem/move" }
move-table-extension = { git = "https://github.com/diem/move" }
move-core-types = { git = "https://github.com/diem/move" }
Expand Down
32 changes: 7 additions & 25 deletions protocol-units/bridge/config/src/common/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ const DEFAULT_ETH_RPC_CONNECTION_HOSTNAME: &str = "localhost";
const DEFAULT_ETH_RPC_CONNECTION_PORT: u16 = 8545;
const DEFAULT_ETH_WS_CONNECTION_HOSTNAME: &str = "localhost";
const DEFAULT_ETH_WS_CONNECTION_PORT: u16 = 8545; // same as RPC
const DEFAULT_ETH_INITIATOR_CONTRACT: &str = "Oxeee";
const DEFAULT_ETH_COUNTERPARTY_CONTRACT: &str = "0xccc";
const DEFAULT_ETH_NATIVE_CONTRACT: &str = "Oxeee";
const DEFAULT_ETH_WETH_CONTRACT: &str = "0xe3e3";
const DEFAULT_ETH_MOVETOKEN_CONTRACT: &str = "0xe3e2";
const DEFAULT_ASSET: &str = "MOVE";
Expand All @@ -34,10 +33,8 @@ pub struct EthConfig {
#[serde(default)]
// Eth chain config.
pub eth_chain_id: u64,
#[serde(default = "default_eth_initiator_contract")]
pub eth_initiator_contract: String,
#[serde(default = "default_eth_counterparty_contract")]
pub eth_counterparty_contract: String,
#[serde(default = "default_eth_native_contract")]
pub eth_native_contract: String,
#[serde(default = "default_eth_weth_contract")]
pub eth_weth_contract: String,
#[serde(default = "default_eth_move_token_contract")]
Expand All @@ -46,9 +43,6 @@ pub struct EthConfig {
#[serde(default = "default_signer_private_key")]
pub signer_private_key: String,

#[serde(default = "default_time_lock_secs")]
pub time_lock_secs: u64,

#[serde(default = "default_gas_limit")]
pub gas_limit: u64,
#[serde(default = "default_transaction_send_retries")]
Expand All @@ -69,17 +63,10 @@ env_default!(
);

env_default!(
default_eth_initiator_contract,
"ETH_INITIATOR_CONTRACT",
default_eth_native_contract,
"ETH_NATIVE_CONTRACT",
String,
DEFAULT_ETH_INITIATOR_CONTRACT.to_string()
);

env_default!(
default_eth_counterparty_contract,
"ETH_COUNTERPARTY_CONTRACT",
String,
DEFAULT_ETH_COUNTERPARTY_CONTRACT.to_string()
DEFAULT_ETH_NATIVE_CONTRACT.to_string()
);

env_default!(
Expand All @@ -97,8 +84,6 @@ env_default!(

env_default!(default_asset, "ASSET", String, DEFAULT_ASSET.to_string());

env_short_default!(default_time_lock_secs, u64, 48 * 60 * 60 as u64); //48h by default

env_short_default!(default_gas_limit, u64, 10_000_000_000_000_000 as u64);

env_short_default!(default_transaction_send_retries, u32, 10 as u32);
Expand Down Expand Up @@ -185,13 +170,10 @@ impl Default for EthConfig {
eth_ws_connection_port: default_eth_ws_connection_port(),
eth_chain_id: default_eth_chain_id(),

eth_initiator_contract: default_eth_initiator_contract(),
eth_counterparty_contract: default_eth_counterparty_contract(),
eth_native_contract: default_eth_native_contract(),
eth_weth_contract: default_eth_weth_contract(),
eth_move_token_contract: default_eth_move_token_contract(),

time_lock_secs: default_time_lock_secs(),

signer_private_key: default_signer_private_key(),
gas_limit: default_gas_limit(),
transaction_send_retries: default_transaction_send_retries(),
Expand Down
Loading
Loading