Skip to content

Commit 97029ec

Browse files
authored
Merge branch 'main' into feature/da-sequencer-node
2 parents 746421c + 071ff67 commit 97029ec

File tree

14 files changed

+139
-76
lines changed

14 files changed

+139
-76
lines changed

.gitmodules

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,7 @@
2828
[submodule "protocol-units/settlement/mcr/contracts/lib/solmate"]
2929
path = protocol-units/settlement/mcr/contracts/lib/solmate
3030
url = https://github.com/transmissions11/solmate
31-
[submodule "dispute-forge-std"]
32-
path = protocol-units/dispute/lib/forge-std
33-
url = https://github.com/foundry-rs/forge-std
34-
[submodule "dispute-openzeppelin-contracts"]
35-
path = protocol-units/dispute/lib/openzeppelin-contracts
36-
url = https://github.com/OpenZeppelin/openzeppelin-contracts
37-
[submodule "dispute-murky"]
38-
path = protocol-units/dispute/lib/murky
39-
url = https://github.com/dmfxyz/murky
31+
4032
[submodule "protocol-units/tokens/mock/testnet/holesky/lib/openzeppelin-contracts"]
4133
path = protocol-units/tokens/mock/testnet/holesky/lib/openzeppelin-contracts
4234
url = https://github.com/OpenZeppelin/openzeppelin-contracts
@@ -45,4 +37,4 @@
4537
url = https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary
4638
[submodule "protocol-units/settlement/mcr/contracts/lib/v2-periphery"]
4739
path = protocol-units/settlement/mcr/contracts/lib/v2-periphery
48-
url = https://github.com/Uniswap/v2-periphery
40+
url = https://github.com/Uniswap/v2-periphery

Cargo.lock

Lines changed: 16 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ google-cloud-kms = "0.6.0"
152152

153153
# Serialization and Deserialization
154154
serde = "1.0"
155-
serde_json = "1.0"
155+
serde_json = "1.0.140"
156156
serde_derive = "1.0"
157157
serde_yaml = "0.9.34"
158158
borsh = { version = "0.10" } # todo: internalize jmt and bump
@@ -203,8 +203,8 @@ move-package = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "1
203203
movement = { git = "https://github.com/movementlabsxyz/aptos-core", rev = "1d1cdbbd7fabb80dcb95ba5e23213faa072fab67" }
204204

205205
# Indexer
206-
processor = { git = "https://github.com/movementlabsxyz/aptos-indexer-processors", rev = "ceaff42dfb4d1e5c84ee45e7568bb071de4b07f2" }
207-
server-framework = { git = "https://github.com/movementlabsxyz/aptos-indexer-processors", rev = "ceaff42dfb4d1e5c84ee45e7568bb071de4b07f2" }
206+
processor = { git = "https://github.com/movementlabsxyz/aptos-indexer-processors", rev = "20be1190105908fd4fea4e78c330997658e9428e" }
207+
server-framework = { git = "https://github.com/movementlabsxyz/aptos-indexer-processors", rev = "20be1190105908fd4fea4e78c330997658e9428e" }
208208

209209
bcs = { git = "https://github.com/movementlabsxyz/bcs.git", rev = "bc16d2d39cabafaabd76173dd1b04b2aa170cf0c" }
210210

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
The Movement SDK is a collection of tools and libraries for building, deploying, and working with Movement Labs infrastructure. The SDK is designed to be modular and extensible, allowing developers to build custom tools and libraries on top of the core components as well as to interact with Movement Labs' own networks.
1515

1616
## Important
17-
Unless otherwise specified assume all commands below are run after entering a nix shell with `nix develop`. Development is made possible Within the Nix environment with all needed tooling being available. If you are wishing to run the network then this can also be achieved without the need to install `nix` with having docker and [just](https://github.com/casey/just) installed only.
17+
Unless otherwise specified assume all commands below are run after entering a nix shell with `nix develop`. Development is made possible Within the Nix environment with all needed tooling being available. If you wish to run the network then this can also be achieved without the need to install `nix` with having docker and [just](https://github.com/casey/just) installed only.
1818

1919
## Organization
2020
- [`scripts`](./scripts): Scripts for running Movement Labs software. See the [scripts README](./scripts/README.md) for more information about the organization of scripts.

docker/compose/movement-indexer/.remote-movement-node.env

Lines changed: 0 additions & 11 deletions
This file was deleted.

networks/movement/movement-full-node/src/common_args.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use anyhow::Context;
12
use clap::Parser;
23
use dot_movement::DotMovement;
34
use godfig::{backend::config_file::ConfigFile, Godfig};
@@ -30,7 +31,10 @@ impl MovementArgs {
3031
/// Get the config
3132
pub async fn config(&self) -> Result<Config, anyhow::Error> {
3233
let dot_movement = self.dot_movement()?;
33-
let config_file = dot_movement.try_get_or_create_config_file().await?;
34+
let config_file = dot_movement
35+
.try_get_or_create_config_file()
36+
.await
37+
.context("Failed to get or create config file")?;
3438
let godfig: Godfig<Config, ConfigFile> = Godfig::new(ConfigFile::new(config_file), vec![]);
3539

3640
godfig.try_wait_for_ready().await.map_err(|e| e.into())

protocol-units/execution/maptos/framework/releases/pre-l1-merge/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
pub mod cached;
22

33
use aptos_framework_upgrade_gas_release::generate_gas_upgrade_module;
4+
/// Expose the `maptos_framework_release_util` crate for use in the `pre-l1-merge` release.
5+
pub use maptos_framework_release_util;
46
use maptos_framework_release_util::commit_hash_with_script;
57

68
// Example usage of the macro to generate a build script for PreL1Merge.

protocol-units/execution/maptos/opt-executor/src/executor/initialization.rs

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@ use crate::executor::EXECUTOR_CHANNEL_SIZE;
55
use crate::{bootstrap, Context};
66
use anyhow::Context as _;
77
use aptos_config::config::NodeConfig;
8-
#[cfg(test)]
98
use aptos_crypto::ed25519::Ed25519PrivateKey;
109
use aptos_crypto::ed25519::Ed25519PublicKey;
11-
#[cfg(test)]
1210
use aptos_crypto::ValidCryptoMaterialStringExt;
1311
use aptos_executor::block_executor::BlockExecutor;
1412
use aptos_mempool::MempoolClientRequest;
@@ -21,6 +19,21 @@ use movement_signer::Signing;
2119
#[cfg(test)]
2220
use movement_signer_loader::identifiers::{local::Local, SignerIdentifier};
2321
use movement_signer_loader::{Load, LoadedSigner};
22+
//=======
23+
//use aptos_types::transaction::SignedTransaction;
24+
//use maptos_execution_util::config::Config;
25+
26+
//use movement_signer_loader::identifiers::{local::Local, SignerIdentifier};
27+
28+
//use anyhow::Context as _;
29+
//use aptos_crypto::Uniform;
30+
//use futures::channel::mpsc as futures_mpsc;
31+
//use movement_collections::garbage::{counted::GcCounter, Duration};
32+
//use tokio::sync::mpsc;
33+
34+
//use tempfile::TempDir;
35+
36+
//>>>>>>> main
2437
use std::net::ToSocketAddrs;
2538
use std::sync::{Arc, RwLock};
2639
use tempfile::TempDir;
@@ -32,10 +45,6 @@ impl Executor {
3245
public_key: Ed25519PublicKey,
3346
mempool_tx_exec_result_sender: UnboundedSender<Vec<TxExecutionResult>>,
3447
) -> Result<Self, anyhow::Error> {
35-
// get dot movement
36-
// todo: this is a slight anti-pattern, but it's fine for now
37-
let dot_movement = DotMovement::try_from_env()?;
38-
3948
// set up the node config
4049
let mut node_config = NodeConfig::default();
4150

@@ -100,7 +109,8 @@ impl Executor {
100109

101110
// indexer table info config
102111
node_config.indexer_table_info.enabled = true;
103-
node_config.storage.dir = dot_movement.get_path().join("maptos-storage");
112+
let db_dir = maptos_config.chain.maptos_db_path.as_ref().context("No db path provided.")?;
113+
node_config.storage.dir = db_dir.join("maptos-storage");
104114
node_config.storage.set_data_dir(node_config.storage.dir.clone());
105115

106116
let known_release = aptos_framework_known_release::KnownRelease::try_new(
@@ -193,6 +203,36 @@ impl Executor {
193203
Ok((executor, tempdir))
194204
}
195205

206+
pub async fn try_generated() -> Result<
207+
(
208+
Self,
209+
TempDir,
210+
Ed25519PrivateKey,
211+
futures::channel::mpsc::Receiver<Vec<TxExecutionResult>>,
212+
),
213+
anyhow::Error,
214+
> {
215+
// generate a random private key
216+
let private_key = Ed25519PrivateKey::generate_for_testing();
217+
218+
// generate a sender
219+
let (mempool_tx_exec_result_sender, receiver) =
220+
futures_mpsc::channel::<Vec<TxExecutionResult>>(EXECUTOR_CHANNEL_SIZE);
221+
let tempdir = tempfile::tempdir()?;
222+
223+
let mut maptos_config = Config::default();
224+
let raw_private_key_hex = private_key.to_encoded_string()?.to_string();
225+
let prefix_stripped =
226+
raw_private_key_hex.strip_prefix("0x").unwrap_or(&raw_private_key_hex);
227+
maptos_config.chain.maptos_private_key_signer_identifier =
228+
SignerIdentifier::Local(Local { private_key_hex_bytes: prefix_stripped.to_string() });
229+
230+
// replace the db path with the temporary directory
231+
maptos_config.chain.maptos_db_path.replace(tempdir.path().to_path_buf());
232+
let executor = Self::try_from_config(maptos_config, mempool_tx_exec_result_sender).await?;
233+
Ok((executor, tempdir, private_key, receiver))
234+
}
235+
196236
/// Creates an instance of [`Context`] and the background [`TransactionPipe`]
197237
/// task to process transactions. If the configuration is for a read-only node,
198238
/// `None` is returned instead of the transaction pipe task.

protocol-units/execution/maptos/opt-executor/src/executor/mod.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ use aptos_executor::block_executor::BlockExecutor;
99
use aptos_executor_types::StateComputeResult;
1010
use aptos_sdk::types::account_address::AccountAddress;
1111
use aptos_sdk::types::ledger_info::LedgerInfoWithSignatures;
12+
use aptos_storage_interface::state_view::{DbStateView, DbStateViewAtVersion};
1213
use aptos_storage_interface::{DbReader, DbReaderWriter};
14+
use aptos_types::state_store::StateView;
1315
use aptos_types::transaction::TransactionStatus;
1416
use aptos_types::validator_signer::ValidatorSigner;
1517
use aptos_vm::AptosVM;
@@ -141,9 +143,9 @@ pub struct Executor {
141143
// Shared reference on the counter of transactions in flight.
142144
transactions_in_flight: Arc<RwLock<GcCounter>>,
143145
// The config for the executor.
144-
pub(crate) config: Config,
146+
pub config: Config,
145147
/// The node config derived from the maptos config.
146-
pub(crate) node_config: NodeConfig,
148+
pub node_config: NodeConfig,
147149
}
148150

149151
impl Executor {
@@ -155,6 +157,15 @@ impl Executor {
155157
Arc::clone(&self.db().reader)
156158
}
157159

160+
pub fn state_view_at_version(
161+
&self,
162+
version: Option<u64>,
163+
) -> Result<DbStateView, anyhow::Error> {
164+
let reader = self.db_reader();
165+
let state_view = reader.state_view_at_version(version)?;
166+
Ok(state_view)
167+
}
168+
158169
pub fn decrement_transactions_in_flight(&self, count: u64) {
159170
// unwrap because lock is poisoned
160171
let mut transactions_in_flight = self.transactions_in_flight.write().unwrap();

protocol-units/execution/maptos/opt-executor/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ pub use context::Context;
1111
pub use executor::Executor;
1212
pub use service::Service;
1313

14+
// Re-export dependencies
15+
pub use aptos_crypto;
16+
pub use aptos_db;
17+
pub use aptos_executor;
18+
pub use aptos_executor_test_helpers;
19+
pub use aptos_sdk;
20+
pub use aptos_storage_interface;
21+
pub use aptos_types;
22+
1423
#[cfg(test)]
1524
mod tests {
1625

0 commit comments

Comments
 (0)