feat: consolidate Zone scenario support#170
Draft
Zygimantass wants to merge 47 commits into
Draft
Conversation
# Conflicts: # Cargo.lock # README.md # crates/bench-core/src/lib.rs # crates/bench-core/src/sender.rs # crates/txgen-ethereum/src/lib.rs # crates/txgen-tempo/Cargo.toml
Route sender-scoped scenario requests through per-chain authenticated submission endpoints while keeping checkpoint and log queries on query RPCs.\n\nWrite reports before returning a failed exit status, and preflight sender authentication before setup dispatch.
- add a chain-neutral scenario `invoke` step for adapter-defined,
query-only actions
- add Tempo's `prepare_encrypted_deposit`, matching viem's
`zone.encryptedDeposit.prepareRecipient` input/output shape and ECIES
format
- allow named or positional Solidity tuple arguments so the returned
`encrypted` object can flow directly into `depositEncrypted`
- validate fixed-size ABI byte lengths instead of padding, truncating,
or panicking
For every invocation, txgen:
1. reads `encryptionKeyCount()` and `sequencerEncryptionKey()` from the
active ZonePortal
2. derives `keyIndex = count - 1`, retrying if the key rotates between
reads
3. creates a fresh secp256k1 ephemeral key and 12-byte nonce from
`OsRng`
4. derives the AES-256-GCM key using the same ECDH/HKDF inputs as viem
and Zones
5. returns viem-compatible `chainId`, `encrypted`, `keyIndex`,
`portalAddress`, and `zoneId` fields
The deterministic crypto test uses a cross-language vector, and the RPC
tests cover active-key lookup and the no-key failure path.
```yaml
- invoke:
chain: l1
action: prepare_encrypted_deposit
with:
recipient: { var: user.address }
zoneId: 9
portalAddress: ${ZONE_PORTAL_ADDRESS}
save: prepared
- submit:
chain: l1
template: encrypted_deposit
with:
call:
args:
- ${TOKEN_ADDRESS}
- 1000000
- { var: prepared.keyIndex }
- { var: prepared.encrypted }
```
- `cargo +nightly fmt --all -- --check`
- `cargo test --workspace`
- `cargo clippy --workspace --all-targets -- -D warnings`
This targets `dan/zones-716-txgen` because it depends on the multi-chain
scenario engine currently under review in #157. It can be
rebased/retargeted after that stack lands.
…lure-fixes # Conflicts: # crates/txgen-cli/src/scenario/mod.rs
…eporting # Conflicts: # README.md # crates/txgen-cli/src/scenario/report.rs
…mp/zones-txgen-consolidated
…mp/zones-txgen-consolidated
… into amp/zones-txgen-consolidated # Conflicts: # Cargo.lock # README.md # crates/bench-core/src/lib.rs # crates/bench-core/src/sender.rs # crates/txgen-ethereum/src/lib.rs # crates/txgen-tempo/Cargo.toml
… into amp/zones-txgen-consolidated # Conflicts: # README.md # crates/bench-core/src/sender.rs # crates/txgen-cli/src/scenario/composition.rs # crates/txgen-cli/src/scenario/mod.rs
…amp/zones-txgen-consolidated
… amp/zones-txgen-consolidated # Conflicts: # crates/txgen-cli/src/scenario/schema.rs # crates/txgen-tempo/src/lib.rs
…nto amp/zones-txgen-consolidated # Conflicts: # crates/txgen-cli/src/scenario/engine.rs
Consolidate the open Zone txgen changes and route adapter invocations through the query provider.
…lidated # Conflicts: # crates/txgen-cli/src/scenario/schema.rs # crates/txgen-cli/src/scenario/value.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consolidates the currently open Zone-related txgen work into one integration branch:
Also resolves the integration conflict so adapter scenario actions use the chain's query provider.
Validation
cargo +nightly fmt --all -- --checkcargo test -p txgen-cli --lib(106 passed)cargo test -p txgen-tempo --lib(43 passed, 1 ignored)cargo test -p txgen-ethereumcargo build -p txgen-tempo --bin txgen-tempogit diff --checkFollow-up
The workflows integration will target
zone-unstable(Zone ID 2, chain ID 421700002). Its public RPC is used for queries and its authenticated private RPC for submissions.