Skip to content
Open
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
6 changes: 3 additions & 3 deletions data/genesis/demo-da-committees.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
base_version = "0.5"
upgrade_version = "0.5"
genesis_version = "0.5"
drb_difficulty = 30
drb_difficulty = 10
drb_upgrade_difficulty = 20
epoch_height = 30
epoch_start_block = 1
Expand All @@ -16,7 +16,7 @@ max_block_size = "1mb"
base_fee = "1 wei"
fee_recipient = "0x0000000000000000000000000000000000000000"
fee_contract = "0x8ce361602b935680e8dec218b820ff5056beb7af"
stake_table_contract = "0x12975173b87f7595ee45dffb2ab812ece596bf84"
stake_table_contract = "0xf7cd8fa9b94db2aa972023b379c7f72c65e4de9d"

[header]
timestamp = "1970-01-01T00:00:00Z"
Expand All @@ -27,7 +27,7 @@ max_block_size = "1mb"
base_fee = "1 wei"
fee_recipient = "0x0000000000000000000000000000000000000000"
fee_contract = "0x8ce361602b935680e8dec218b820ff5056beb7af"
stake_table_contract = "0x12975173b87f7595ee45dffb2ab812ece596bf84"
stake_table_contract = "0xf7cd8fa9b94db2aa972023b379c7f72c65e4de9d"

[l1_finalized]
number = 0
Expand Down
9 changes: 8 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ demo-native-drb-header *args: (build "test" "--no-default-features --features dr
demo-native-fee-to-drb-header-upgrade *args: (build "test" "--no-default-features --features fee,drb-and-header")
ESPRESSO_SEQUENCER_GENESIS_FILE=data/genesis/demo-fee-to-drb-header-upgrade.toml scripts/demo-native -f process-compose.yaml {{args}}

demo-native-da-committees *args: (build "test" "--no-default-features --features da-upgrade")
ESPRESSO_SEQUENCER_GENESIS_FILE=data/genesis/demo-da-committees.toml scripts/demo-native -f process-compose.yaml {{args}}

demo-native-benchmark:
cargo build --release --features benchmarking
scripts/demo-native
Expand Down Expand Up @@ -152,9 +155,13 @@ test-demo test_name:
features="--no-default-features --features drb-and-header"
test="test_native_demo_drb_header_base"
;;
da-committees)
features="--no-default-features --features da-upgrade"
test="test_native_demo_drb_header_base"
;;
*)
echo "Unknown test: {{test_name}}"
echo "Available tests: base, pos-base, drb-header-base, pos-upgrade, drb-header-upgrade, fee-to-drb-header-upgrade"
echo "Available tests: base, pos-base, drb-header-base, pos-upgrade, drb-header-upgrade, fee-to-drb-header-upgrade, da-committees"
exit 1
;;
esac
Expand Down
6 changes: 3 additions & 3 deletions staking-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ authors = { workspace = true }
edition = { workspace = true }
description = "A CLI to interact with the Espresso stake table contract"

[features]
testing = ["warp"]

[dependencies]
alloy = { workspace = true }
anyhow = { workspace = true }
Expand Down Expand Up @@ -52,8 +55,5 @@ staking-cli = { path = ".", features = ["testing"] }
tempfile = { workspace = true }
test-log = { workspace = true }

[features]
testing = ["warp"]

[lints]
workspace = true
14 changes: 7 additions & 7 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ authors = { workspace = true }
edition = { workspace = true }
publish = false

[features]
default = ["fee", "pos", "drb-and-header", "da-upgrade"]
fee = ["sequencer/fee"]
pos = ["sequencer/pos"]
drb-and-header = ["sequencer/drb-and-header"]
da-upgrade = ["sequencer/da-upgrade"]

[dependencies]
hotshot-query-service = { workspace = true }
serde_json = { workspace = true }
Expand Down Expand Up @@ -41,12 +48,5 @@ vbs = { workspace = true }
name = "integration"
path = "main.rs"

[features]
default = ["fee", "pos", "drb-and-header", "da-upgrade"]
fee = ["sequencer/fee"]
pos = ["sequencer/pos"]
drb-and-header = ["sequencer/drb-and-header"]
da-upgrade = ["sequencer/da-upgrade"]

[lints]
workspace = true
16 changes: 2 additions & 14 deletions tests/proof_of_stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,8 @@ async fn test_native_demo_da_committee() -> Result<()> {
.await?;
}

let epoch_length = genesis
.epoch_height
.expect("epoch_height not set in genesis");
// Run for a least 3 epochs plus a few blocks to confirm we can make progress once
// we are using the stake table from the contract.
let expected_block_height = epoch_length * 21 + 10; // Make sure we're past epoch 21

let pos_progress_requirements = TestRequirements {
block_height_increment: expected_block_height,
txn_count_increment: 2 * expected_block_height,
global_timeout: Duration::from_secs(expected_block_height as u64 * 3),
..Default::default()
};
assert_native_demo_works(pos_progress_requirements).await?;
// Sanity check that the demo is still working
assert_native_demo_works(Default::default()).await?;

Ok(())
}
Expand Down
Loading