feat: batcher alt-DA CLI flags and service wiring#3615
Conversation
| alt_da: if self.altda_enabled { | ||
| let server_url = self | ||
| .altda_da_server | ||
| .ok_or_else(|| eyre::eyre!("--altda-enabled requires --altda-da-server"))?; | ||
| let client = base_alt_da::Client::new(server_url) | ||
| .map_err(|e| eyre::eyre!("failed to create alt-da client: {e}"))?; | ||
| Some(std::sync::Arc::new(AltDaClientAdapter(client)) | ||
| as base_batcher_core::DynAltDaClient) | ||
| } else { | ||
| None | ||
| }, |
There was a problem hiding this comment.
nit: --altda-da-server without --altda-enabled is silently discarded. An operator could set the server URL, forget the enable flag, and wonder why alt-DA isn't working. Consider warning in validate() (or here) when altda_da_server.is_some() && !altda_enabled:
if !self.altda_enabled && self.altda_da_server.is_some() {
tracing::warn!("--altda-da-server is set but --altda-enabled is false; alt-DA is disabled");
}| url.workspace = true | ||
| eyre.workspace = true | ||
| base-alt-da.workspace = true | ||
| base-protocol.workspace = true | ||
| base-cli-utils.workspace = true | ||
| async-trait.workspace = true | ||
| base-batcher-core.workspace = true | ||
| alloy-signer-local.workspace = true |
There was a problem hiding this comment.
Per project convention (CLAUDE.md): dependencies should be sorted by line length (waterfall style). async-trait (shorter) is listed after base-cli-utils (longer). Suggested order:
| url.workspace = true | |
| eyre.workspace = true | |
| base-alt-da.workspace = true | |
| base-protocol.workspace = true | |
| base-cli-utils.workspace = true | |
| async-trait.workspace = true | |
| base-batcher-core.workspace = true | |
| alloy-signer-local.workspace = true | |
| url.workspace = true | |
| eyre.workspace = true | |
| async-trait.workspace = true | |
| base-alt-da.workspace = true | |
| base-protocol.workspace = true | |
| base-cli-utils.workspace = true | |
| base-batcher-core.workspace = true | |
| alloy-signer-local.workspace = true |
6306d4b to
fb85817
Compare
c8801b6 to
bb1063d
Compare
fb85817 to
4c02168
Compare
bb1063d to
005bfaa
Compare
| if self.alt_da.is_some() && self.encoder_config.da_type != DaType::Calldata { | ||
| eyre::bail!( | ||
| "alt-da dual-write requires --data-availability-type calldata; \ | ||
| blob submissions are not dual-written to the DA server" | ||
| ); | ||
| } |
There was a problem hiding this comment.
When alt_da is enabled and force_blobs_when_throttling is true (the default), a DA-backlog throttle event will silently switch the encoder to blob mode and stop dual-writing to alt-DA — the submission queue only clones alt_da_body for DaType::Calldata. An operator relying on the dual-write shadow path for validation may not realize it has gaps during throttle windows.
Consider warning here (or rejecting the combination) so operators are aware:
if self.alt_da.is_some() && self.force_blobs_when_throttling {
tracing::warn!(
"alt-da dual-write will pause during DA-backlog throttle events \
(throttling forces blob mode, which skips alt-DA); \
pass --no-force-blobs-when-throttling to keep dual-write continuous"
);
}- Client::put uploads batch bytes and returns a validated 34-byte generic commitment for L1 posting - read a bounded snippet of the server error body on non-2xx responses so operators see diagnostics - encode_commitment_tx_data prefixes DERIVATION_VERSION_1 for the commitment L1 tx - CommitmentError decouples commitment validation from the server Error enum - drop redundant reqwest dev-dependency
Move test imports to mod scope and drop redundant DERIVATION_VERSION_1 import.
Fire-and-forget PUT plus commitment txs alongside calldata, with shadow concurrency cap and reorg abort.
Log submission ids in shadow tasks, warn on missing commitment block number, and avoid redundant alt_da clone in SubmissionQueue::new.
4c02168 to
3ca9749
Compare
005bfaa to
c0c56ed
Compare
Fix lib.rs re-export ordering and shadow-path indentation.
Add BATCHER_ALTDA_ENABLED and BATCHER_ALTDA_DA_SERVER; inject base-alt-da client via binary adapter.
Warn when alt-DA server URL is set without enable flag or when dual-write conflicts with throttle-driven blob override; sort batcher bin deps by line length.
c0c56ed to
9bfee0f
Compare
Wrap long warn! string to satisfy workspace rustfmt.
Review SummaryClean PR that adds alt-DA CLI flags and wires the ArchitectureThe adapter pattern here is the right call. The ValidationThe validation has good layered coverage:
Test coverage is adequate — the three new tests cover the missing-server-URL, happy-path, and blob-DA-rejection cases. Existing inline commentsThe three inline comments from the previous review run are still relevant and cover the notable findings. No additional issues found. |
❌ base-std fork tests did not runThe build or setup step failed before any tests could execute. Check the workflow logs for details. |
20e24f1 to
2e8679c
Compare
- Stub alt_da: None in batcher service until #3615 wires the client - Collapse nested if in shadow path for clippy - Point UPGRADES.md hardfork test link at l3 branch
|
Combined into #3614 for PRIV-1972. |
wire batcher CLI flags for alt-DA dual-write on privacy devnet:
Summary
BATCHER_ALTDA_ENABLEDandBATCHER_ALTDA_DA_SERVERCLI flagsbase-alt-daclient via binary adapter (keeps crate layering)Context
Depends on #3614. Enables dual-write on the privacy L3 devnet once merged; privacy-enclave compose follow-up sets flags on
base-batcherafter this stack lands.Test plan
cargo test -p base-batcher-bincargo check -p base-batcher-bintype=routine
risk=low
impact=sev5