Skip to content

Commit

Permalink
Merge pull request #11 from chainwayxyz/initial-port
Browse files Browse the repository at this point in the history
Initial port from Citrea
  • Loading branch information
jfldde authored Oct 3, 2024
2 parents d8a530f + 06c4189 commit c2c7456
Show file tree
Hide file tree
Showing 41 changed files with 3,894 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ Cargo.lock
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
#.idea/

# Added by cargo

/target
40 changes: 40 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[package]
name = "citrea-e2e"
version = "0.1.0"
edition = "2021"
resolver = "2"

[dependencies]
anyhow = { version = "1.0.68", default-features = false, features = ["std"] }
async-trait = "0.1.71"
bitcoin = { version = "0.32.2", features = ["serde", "rand"] }
bitcoincore-rpc = { version = "0.18.0" }
bollard = { version = "0.17.1" }
futures = "0.3"
log = "0.4"
rand = "0.8"
serde = { version = "1.0.192", default-features = false, features = ["alloc", "derive"] }
serde_json = { version = "1.0", default-features = false }
tempfile = "3.8"
tokio = { version = "1.39", features = ["full"] }
toml = "0.8.0"
which = "6.0.3"

# Eth client dependencies
alloy = { version = "0.2.1", features = ["hyper", "consensus", "rpc-types-eth", "provider-http", "signers", "signer-local"] }
jsonrpsee = { version = "0.24.2", features = ["http-client", "ws-client"] }
reqwest = { version = "0.12.5", features = ["rustls-tls", "json", "http2"], default-features = false }
reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "a206eb3690e5a51d3c797fed2a6ed722e36863eb", default-features = false }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth", rev = "a206eb3690e5a51d3c797fed2a6ed722e36863eb", default-features = false }
reth-rpc-types = { git = "https://github.com/paradigmxyz/reth", rev = "a206eb3690e5a51d3c797fed2a6ed722e36863eb", default-features = false, features = ["jsonrpsee-types"] }

# Citrea dependencies
bitcoin-da = { git = "https://github.com/chainwayxyz/citrea", features = ["native"] }
citrea-primitives = { git = "https://github.com/chainwayxyz/citrea" }
citrea-sequencer = { git = "https://github.com/chainwayxyz/citrea" }
sov-ledger-rpc = { git = "https://github.com/chainwayxyz/citrea", features = ["client"] }
sov-rollup-interface = { git = "https://github.com/chainwayxyz/citrea" }
sov-stf-runner = { git = "https://github.com/chainwayxyz/citrea", features = ["native"] }

[patch.crates-io]
bitcoincore-rpc = { version = "0.18.0", git = "https://github.com/chainwayxyz/rust-bitcoincore-rpc.git", rev = "0ae498d" }
45 changes: 45 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
.PHONY: help

help: ## Display this help message
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

.PHONY: build
build: ## Build the project
@cargo build


clean: ## Cleans compiled
@cargo clean

install-dev-tools: ## Installs all necessary cargo helpers
cargo install --locked dprint
cargo install cargo-llvm-cov
cargo install cargo-hack
cargo install --locked cargo-udeps
cargo install flaky-finder
cargo install --locked cargo-nextest
cargo install --version 1.7.0 cargo-binstall
cargo binstall --no-confirm [email protected]
cargo risczero install --version r0.1.79.0-2
rustup target add thumbv6m-none-eabi
rustup component add llvm-tools-preview

lint: ## cargo check and clippy. Skip clippy on guest code since it's not supported by risc0
## fmt first, because it's the cheapest
dprint check
cargo +nightly fmt --all --check
cargo check --all-targets --all-features
$(MAKE) check-fuzz
SKIP_GUEST_BUILD=1 cargo clippy --all-targets --all-features

lint-fix: ## dprint fmt, cargo fmt, fix and clippy. Skip clippy on guest code since it's not supported by risc0
dprint fmt
cargo +nightly fmt --all
cargo fix --allow-dirty
SKIP_GUEST_BUILD=1 cargo clippy --fix --allow-dirty

docs: ## Generates documentation locally
cargo doc --open

set-git-hook:
git config core.hooksPath .githooks
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# citrea-e2e

E2E Test framework for citrea
11 changes: 11 additions & 0 deletions dprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"markdown": {
},
"toml": {
},
"excludes": [],
"plugins": [
"https://plugins.dprint.dev/markdown-0.17.8.wasm",
"https://plugins.dprint.dev/toml-0.6.3.wasm"
]
}
3 changes: 3 additions & 0 deletions resources/genesis/bitcoin-regtest/accounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pub_keys": []
}
158 changes: 158 additions & 0 deletions resources/genesis/bitcoin-regtest/evm.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"max_l2_blocks_per_l1": 86400,
"authority": "sov1l6n2cku82yfqld30lanm2nfw43n2auc8clw7r5u5m6s7p8jrm4zqrr8r94"
}
3 changes: 3 additions & 0 deletions resources/genesis/devnet/accounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pub_keys": []
}
38 changes: 38 additions & 0 deletions resources/genesis/devnet/evm.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions resources/genesis/devnet/soft_confirmation_rule_enforcer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"max_l2_blocks_per_l1": 86400,
"authority": "sov1tz5dqrfqrtcsejn4ux7a3dscljqcgvxzf4qarcl5tmqsgsymxw3se4x3a0"
}
3 changes: 3 additions & 0 deletions resources/genesis/mock-dockerized/accounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pub_keys": []
}
158 changes: 158 additions & 0 deletions resources/genesis/mock-dockerized/evm.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"max_l2_blocks_per_l1": 86400,
"authority": "sov1l6n2cku82yfqld30lanm2nfw43n2auc8clw7r5u5m6s7p8jrm4zqrr8r94"
}
3 changes: 3 additions & 0 deletions resources/genesis/mock/accounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pub_keys": []
}
158 changes: 158 additions & 0 deletions resources/genesis/mock/evm.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions resources/genesis/mock/soft_confirmation_rule_enforcer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"max_l2_blocks_per_l1": 86400,
"authority": "sov1l6n2cku82yfqld30lanm2nfw43n2auc8clw7r5u5m6s7p8jrm4zqrr8r94"
}
3 changes: 3 additions & 0 deletions resources/genesis/testnet/accounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pub_keys": []
}
108 changes: 108 additions & 0 deletions resources/genesis/testnet/evm.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"max_l2_blocks_per_l1": 86400,
"authority": "sov1aw2ex52a6v4j3gfugrafda3jplwhv24xelpvd29k2sak5waypc6qj9jyle"
}
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "1.79"
components = ["rustfmt", "rust-src", "clippy"]
profile = "minimal"
3 changes: 3 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
edition = "2021"
group_imports = "StdExternalCrate"
imports_granularity = "Crate"
Loading

0 comments on commit c2c7456

Please sign in to comment.