feat(venue): add postage venue adapter - #62
Open
mfw78 wants to merge 3 commits into
Open
Conversation
The Swarm postage batch purchase as the second genuine venue: a policy-legible header (enforceable BZZ erc20 gives, display-grade chunk-capacity service want), an indicative quote, and submit answering requires-signing over the createBatch transaction on Gnosis. The conformance kit gains the missing signer mock in MockTransport, playing the host's signing role with teeth on the unsigned-tx wire contract, and the venue publishes its header goldens and body codec vectors. Settlement is two transactions (erc20 approve, then createBatch); the adapter records the shape in its docs, returns the purchase leg only, and leaves the multi-transaction wire decision open. The createBatch calldata is encoded locally via alloy-sol-types, already in the workspace dependency table.
The submit test derived every expectation from the same `sol!` block it was checking, so transposing the two `uint8` parameters left the signature string, the selector and an `abi_decode` round trip all unchanged and the suite green while the host would have been handed a batch with depth and bucket depth swapped. Pin the calldata and the target address as literals instead, covering `immutableFlag` on the second batch since it has no footprint in the header. Answer `status` with `unsupported` rather than `unavailable`: the adapter declares no chain capability, so the verb is permanently unimplementable here and `retry_action` folds `unavailable` into an unbounded try-next-block. Refuse a zero per-chunk balance, which `createBatch` always reverts and which would otherwise derive a header reporting the purchase to policy as free.
`keccak256` already answers a `B256`; widening it to `Vec<u8>` forced callers to assert the length back.
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.
What
Adds
postage-venue, a new venue module implementing the postage stamp batch purchase flow over the blessed#[videre_sdk::venue]path with the logging capability.IntentBodyschemaPostageBody::V1(owner, initial_balance_per_chunk, depth, bucket_depth, nonce, immutable) via borsh.derive_headercomputes the enforceable BZZ erc20 total (per-chunk balance shifted left by depth, checked for EVM-word overflow) and exposes the display-grade chunk capacity as the service asset case.quotemirrors the legs with a zero fee.submitreturns a requires-signing(unsigned-tx) response carrying locallysol!-encodedcreateBatchcalldata targeting the Gnosis postage stamp contract, with empty value since BZZ moves by allowance.Also adds
videre-test/src/signer.rs(mock signer, typed tx hash asb256), goldens/vectors for the postage header and body, and wires the new crate intoCargo.toml/Cargo.lock, CI,justfile,AGENTS.md, andREADME.md.Why
Closes #28
Testing
Independent CI-parity gate, fresh clone of
nullislabs/videre-nexum-moduleat detachedorigin/feat/postage-venue-adapter(b30852d), toolchain rustc 1.94.0 / cargo 1.94.0. Nothing was fixed or pushed in that pass, the branch passed as-is.cargo metadata --lockedclean, soCargo.lockis committed in sync with the manifests;git statusstayed empty after every build (no lock churn).RUSTFLAGS=-D warnings cargo clippy -p postage-venue -p videre-test --all-targets --all-features --locked -- -D warningsclean, zero warnings.cargo test --doc -p postage-venue -p videre-test --all-features --lockedpassed.A prior red-team pass on 2f2149d found the
createBatchunsigned tx had zero independent coverage: the settlement test re-derived every assertion from the samesol!declaration andPOSTAGE_STAMPconstant it was meant to check. Transposinguint8 depthanduint8 bucketDepthin thesol!block exposed this; three real defects were found and fixed, pushed as e47c16c and b30852d.AI Assistance
Implementation by claude-fable-5, red-team review by claude-opus-5, PR authored by claude-sonnet-5.