Skip to content

fix: payment hardening -- pricing, panics, external signer#5

Open
grumbach wants to merge 2 commits intomainfrom
fix/payment-upload-hardening
Open

fix: payment hardening -- pricing, panics, external signer#5
grumbach wants to merge 2 commits intomainfrom
fix/payment-upload-hardening

Conversation

@grumbach
Copy link
Copy Markdown
Contributor

@grumbach grumbach commented Apr 2, 2026

Summary

  • Replace expect() panics with proper Result propagation in PoolCommitment::to_packed() and get_payment_packed_commitments()
  • Add calculate_price() to quoting_metrics.rs so client and node share the same deterministic pricing formula
  • Fix per-node pricing: when contract returns single aggregate price, compute individual prices locally instead of duplicating the same value to all nodes
  • Add merkle payment calldata generation for external signers (pay_for_merkle_tree_calldata())

Dependency note

ant-node and ant-client depend on evmlib 0.5.0 from crates.io. This PR needs a new evmlib release before the other two PRs can use it.

Related PRs

  • WithAutonomi/ant-node — fix/payment-upload-hardening
  • WithAutonomi/ant-client — fix/payment-upload-hardening

Test plan

  • cfd passes
  • 3-agent adversarial review (2 Claude Opus + 1 Codex gpt-5.4) — all issues fixed

- Make pay_for_merkle_tree_calldata() public in the unified PaymentVault handler
- Add pay_for_merkle_tree_calldata() to external_signer.rs with
  MerklePaymentCalldataReturn type for external wallet signing
- Uses the unified PaymentVault API (post-V2 refactor)
@grumbach grumbach force-pushed the fix/payment-upload-hardening branch from c9de1f6 to eff43ab Compare April 3, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant