Skip to content

Commit

Permalink
refactor: start workspace project configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dancoombs committed Sep 12, 2023
1 parent ba65749 commit 53f2d7e
Show file tree
Hide file tree
Showing 133 changed files with 186 additions and 105 deletions.
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
*.iml
.vscode

# Foundry, configured in foundry.toml
contracts/cache/
contracts/out/

# Generated contract bindings, created in build.rs
src/common/contracts/

.env
*.log

Expand Down
12 changes: 6 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[submodule "contracts/lib/account-abstraction"]
path = contracts/lib/account-abstraction
[submodule "crates/rundler/contracts/lib/account-abstraction"]
path = crates/rundler/contracts/lib/account-abstraction
url = https://github.com/eth-infinitism/account-abstraction
branch = v0.5
[submodule "contracts/lib/forge-std"]
path = contracts/lib/forge-std
[submodule "crates/rundler/contracts/lib/forge-std"]
path = crates/rundler/contracts/lib/forge-std
url = https://github.com/foundry-rs/forge-std
branch = chore/v1.5.0
[submodule "foundry/lib/openzeppelin-contracts"]
path = contracts/lib/openzeppelin-contracts
[submodule "crates/rundler/contracts/lib/openzeppelin-contracts"]
path = crates/rundler/contracts/lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
branch = release-v4.8
[submodule "test/spec-tests/bundler-spec-tests"]
Expand Down
26 changes: 25 additions & 1 deletion Cargo.lock

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

82 changes: 14 additions & 68 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,71 +1,17 @@
[package]
name = "rundler"
[workspace]
members = [
"bin/rundler",
"bin/tools",
"crates/rundler"
]
default-members = ["bin/rundler", "bin/tools"]

[workspace.package]
version = "0.1.0-beta"
edition = "2021"
default-run = "rundler"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = "1.0.70"
arrayvec = "0.7.2"
async-stream = "0.3.5"
chrono = "0.4.24"
clap = { version = "4.2.4", features = ["derive", "env"] }
dotenv = "0.15.0"
enum_dispatch = "0.3.11"
ethers = { version = "2.0.8", features = ["ws"] }
ethers-signers = {version = "2.0.8", features = ["aws"] }
futures = "0.3.28"
futures-timer = "3.0.2"
futures-util = "0.3.28"
hyper = "0.14.27"
indexmap = "2.0.0"
itertools = "0.11.0"
jsonrpsee = { version = "0.20.0", features = ["client", "macros", "server"] }
linked-hash-map = "0.5.6"
metrics = "0.21.0"
metrics-exporter-prometheus = "0.12.0"
metrics-process = "1.0.10"
metrics-util = "0.15.0"
parking_lot = "0.12.1"
parse-display = "0.8.0"
pin-project = "1.0.12"
prost = "0.12.0"
prost-types = "0.12.0"
rand = "0.8.5"
reqwest = { version = "0.11.18", default-features = false, features = ["rustls-tls"] }
rslock = "0.2.2"
rustls = "0.21.7"
rusoto_core = { version = "0.48.0", default-features = false, features = ["rustls"] }
rusoto_kms = { version = "0.48.0", default-features = false, features = ["rustls"] }
rusoto_s3 = { version = "0.48.0", default-features = false, features = ["rustls"] }
serde = { version = "1.0.160", features = ["derive"] }
serde_json = "1.0.96"
serde_with = "3.0.0"
sscanf = "0.4.0"
strum = { version = "0.25.0", features = ["derive"] }
thiserror = "1.0.40"
tokio = { version = "1.27.0", features = ["macros", "rt-multi-thread", "signal", "sync"] }
tokio-rustls = "0.24.1"
tokio-stream = { version = "0.1.12", features = ["sync"] }
tokio-util = "0.7.8"
tonic = "0.10.0"
tonic-health = "0.10.0"
tonic-reflection = "0.10.0"
tonic-types = "0.10.0"
tower = "0.4.13"
tower-http = { version = "0.4.0", features = ["trace"] }
tracing = "0.1.37"
tracing-appender = "0.2.2"
tracing-subscriber = { version = "0.3.16", features = ["env-filter", "fmt", "json"] }
url = "2.3.1"

[dev-dependencies]
cargo-husky = { version = "1", default-features = false, features = ["user-hooks" ] }
mockall = "0.11.4"
tokio-util = "0.7.7"
rust-version = "1.71"
license = "MIT OR Apache-2.0"
repository = "https://github.com/alchemyplatform/rundler"

[build-dependencies]
ethers = "2.0.3"
tonic-build = "0.10.0"
[workspace.dependencies]
tokio = { version = "1.27.0", default-features = false }
17 changes: 17 additions & 0 deletions bin/rundler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "rundler"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
description = """
Rundler node implementation
"""

[dependencies]
rundler-rundler = { path = "../../crates/rundler" }

# CLI dependencies
tokio = "1.27.0"
dotenv = "0.15.0"
2 changes: 1 addition & 1 deletion src/main.rs → bin/rundler/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dotenv::dotenv;
use rundler::cli;
use rundler_rundler::cli;

#[tokio::main]
async fn main() {
Expand Down
23 changes: 23 additions & 0 deletions bin/tools/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "rundler-tools"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
description = """
Rundler tools
"""

[dependencies]
rundler-rundler = { path = "../../crates/rundler" }

anyhow = "1.0.70"
clap = { version = "4.2.4", features = ["derive", "env"] }
dotenv = "0.15.0"
ethers = "2.0.8"
ethers-signers = {version = "2.0.8", features = ["aws"] }
rusoto_core = { version = "0.48.0", default-features = false, features = ["rustls"] }
rusoto_kms = { version = "0.48.0", default-features = false, features = ["rustls"] }
serde_json = "1.0.96"
tokio.workspace = true
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use ethers::utils::hex;
use rundler::common::{
use rundler_rundler::common::{
dev,
dev::{DevAddresses, BUNDLER_ACCOUNT_ID, PAYMASTER_SIGNER_ACCOUNT_ID, WALLET_OWNER_ACCOUNT_ID},
};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
let bytecode = include_str!(
"../../contracts/bytecode/entrypoint/0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789.txt",
"../../../../crates/rundler/contracts/bytecode/entrypoint/0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789.txt",
);
let addresses = dev::deploy_dev_contracts(bytecode).await?;
addresses.write_to_env_file()?;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dotenv::dotenv;
use rundler::{common::dev::DevClients, rpc::RpcUserOperation};
use rundler_rundler::{common::dev::DevClients, rpc::RpcUserOperation};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/bin/send_ops.rs → bin/tools/src/bin/send_ops.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use dotenv::dotenv;
use rundler::common::{dev::DevClients, eth};
use rundler_rundler::common::{dev::DevClients, eth};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
Expand All @@ -15,7 +15,7 @@ async fn main() -> anyhow::Result<()> {
// simply call the nonce method multiple times
for i in 0..10 {
println!("Sending op {i}");
let op = clients.new_wallet_op(wallet.get_nonce(), 0.into()).await?;
let op = clients.new_wallet_op(wallet.nonce(), 0.into()).await?;
let call = entry_point.handle_ops(vec![op], bundler_client.address());
eth::await_mined_tx(call.send(), "send user operation").await?;
}
Expand Down
2 changes: 1 addition & 1 deletion buf.work.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version: v1
directories:
- proto
- crates/rundler/proto
8 changes: 0 additions & 8 deletions contracts/foundry.toml

This file was deleted.

1 change: 0 additions & 1 deletion contracts/lib/account-abstraction
Submodule account-abstraction deleted from 9b5f2e
1 change: 0 additions & 1 deletion contracts/lib/forge-std
Submodule forge-std deleted from 73a504
1 change: 0 additions & 1 deletion contracts/lib/openzeppelin-contracts
Submodule openzeppelin-contracts deleted from d00ace
4 changes: 0 additions & 4 deletions contracts/remappings.txt

This file was deleted.

1 change: 1 addition & 0 deletions crates/rundler/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/src/common/contracts
70 changes: 70 additions & 0 deletions crates/rundler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[package]
name = "rundler-rundler"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true

[dependencies]
anyhow = "1.0.70"
arrayvec = "0.7.2"
async-stream = "0.3.5"
chrono = "0.4.24"
clap = { version = "4.2.4", features = ["derive", "env"] }
enum_dispatch = "0.3.11"
ethers = { version = "2.0.8", features = ["ws"] }
ethers-signers = {version = "2.0.8", features = ["aws"] }
futures = "0.3.28"
futures-timer = "3.0.2"
futures-util = "0.3.28"
hyper = "0.14.27"
indexmap = "2.0.0"
itertools = "0.11.0"
jsonrpsee = { version = "0.20.0", features = ["client", "macros", "server"] }
linked-hash-map = "0.5.6"
metrics = "0.21.0"
metrics-exporter-prometheus = "0.12.0"
metrics-process = "1.0.10"
metrics-util = "0.15.0"
parking_lot = "0.12.1"
parse-display = "0.8.0"
pin-project = "1.0.12"
prost = "0.12.0"
prost-types = "0.12.0"
rand = "0.8.5"
reqwest = { version = "0.11.18", default-features = false, features = ["rustls-tls"] }
rslock = "0.2.2"
rustls = "0.21.7"
rusoto_core = { version = "0.48.0", default-features = false, features = ["rustls"] }
rusoto_kms = { version = "0.48.0", default-features = false, features = ["rustls"] }
rusoto_s3 = { version = "0.48.0", default-features = false, features = ["rustls"] }
serde = { version = "1.0.160", features = ["derive"] }
serde_json = "1.0.96"
serde_with = "3.0.0"
sscanf = "0.4.0"
strum = { version = "0.25.0", features = ["derive"] }
thiserror = "1.0.40"
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "signal", "sync"] }
tokio-rustls = "0.24.1"
tokio-stream = { version = "0.1.12", features = ["sync"] }
tokio-util = "0.7.8"
tonic = "0.10.0"
tonic-health = "0.10.0"
tonic-reflection = "0.10.0"
tonic-types = "0.10.0"
tower = "0.4.13"
tower-http = { version = "0.4.0", features = ["trace"] }
tracing = "0.1.37"
tracing-appender = "0.2.2"
tracing-subscriber = { version = "0.3.16", features = ["env-filter", "fmt", "json"] }
url = "2.3.1"

[dev-dependencies]
cargo-husky = { version = "1", default-features = false, features = ["user-hooks" ] }
mockall = "0.11.4"
tokio-util = "0.7.7"

[build-dependencies]
ethers = "2.0.3"
tonic-build = "0.10.0"
File renamed without changes.
2 changes: 2 additions & 0 deletions crates/rundler/contracts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/cache
/out
File renamed without changes.
13 changes: 13 additions & 0 deletions crates/rundler/contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[profile.default]
src = 'src'
out = 'out'
libs = ['lib']
test = 'test'
cache_path = 'cache'

remappings = [
'forge-std/=lib/forge-std/src',
'ds-test/=lib/forge-std/lib/ds-test/src/',
'account-abstraction/=lib/account-abstraction/contracts/',
'@openzeppelin/=lib/openzeppelin-contracts/'
]
1 change: 1 addition & 0 deletions crates/rundler/contracts/lib/account-abstraction
Submodule account-abstraction added at f3b5f7
1 change: 1 addition & 0 deletions crates/rundler/contracts/lib/forge-std
Submodule forge-std added at b1cf26
1 change: 1 addition & 0 deletions crates/rundler/contracts/lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at 0a25c1
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ impl LocalBuilderServerRunner {
})
},
ServerRequestKind::DebugSendBundleNow => {
if !self.manual_bundling_mode.load(Ordering::Relaxed) {
break 'a Err(anyhow::anyhow!("bundling mode is not manual").into())
}

let (tx, rx) = oneshot::channel();
match self.send_bundle_requester.send(SendBundleRequest{
responder: tx
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/common/dev.rs → crates/rundler/src/common/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ impl DevClients {
.context("call executed by wallet should have to address")?;
let nonce = self
.wallet
.get_nonce()
.nonce()
.await
.context("should read nonce from wallet")?;
let call_data = Bytes::clone(
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 53f2d7e

Please sign in to comment.