Skip to content

fix(antd): plumb evm_defaults through prepare_upload; bump evmlib 0.8.1#32

Merged
Nic-dorman merged 1 commit into
mainfrom
fix/antd-prepare-upload-evm-config
Apr 28, 2026
Merged

fix(antd): plumb evm_defaults through prepare_upload; bump evmlib 0.8.1#32
Nic-dorman merged 1 commit into
mainfrom
fix/antd-prepare-upload-evm-config

Conversation

@Nic-dorman
Copy link
Copy Markdown
Collaborator

Summary

  • Fix external-signer prepare_upload to return correct mainnet EVM addresses (rpc_url, token, vault) by routing through evm_defaults::resolve instead of reading raw EVM_RPC_URL / EVM_PAYMENT_TOKEN_ADDRESS / EVM_PAYMENT_VAULT_ADDRESS env vars. Previously a mainnet antd launched with only the network preset returned an empty token addr + http://127.0.0.1:8545 RPC, causing external signers (e.g. indelible) to call ERC-20 approve against the zero address and revert at gas estimation.
  • Refactor evm_defaults to source addresses from evmlib::Network accessors instead of duplicated constants. The literals had drifted after the merkle / single-node payment vault unification.
  • Bump evmlib 0.8.0 → 0.8.1 (fix: correct midpoint level so odd-depth uploads don't revert evmlib#9) — fixes WrongPoolCount revert in payForMerkleTree for odd-depth merkle trees. Inherited transitively; ant-core stays pinned at ant-cli-v0.2.0.

Test plan

  • Unit tests: cargo test evm_defaults:: — 8 pass, including new evmlib accessor cross-checks
  • Live mainnet test via indelible external-signer flow: 51-byte file, real on-chain payment 0.0352 ANT, byte-for-byte readback (SHA256 match)
  • No regression in working internal-wallet path (/v1/files/upload/public)

Out of scope

The merkle external-signer path (files ≥65 chunks) has a separate ant-core pool-collection bug — storers reject pools with candidate pub_keys do not match the network's closest peers to the pool midpoint address. Tracked separately upstream; not part of this fix.

🤖 Generated with Claude Code

build_prepare_response now sources rpc_url + token/vault addresses from
evm_defaults::resolve(network) rather than raw env vars, so a mainnet
antd launched with only the network preset returns the right addresses
to external signers (was returning empty token and 127.0.0.1:8545,
making approve() revert at the zero address).

evm_defaults now pulls addresses from evmlib::Network accessors instead
of duplicated literals — the constants had drifted after the merkle /
single-node payment vault unification, and were the cause of the earlier
wrong-vault bug.

evmlib 0.8.0 -> 0.8.1 (WithAutonomi/evmlib#9) fixes a WrongPoolCount
revert in payForMerkleTree for odd-depth merkle trees (chunk counts in
the bands 5-8, 17-32, 65-128). Inherited transitively; ant-core stays
pinned at ant-cli-v0.2.0.

Validated end-to-end on mainnet: 0.0352 ANT external-signer wave-batch
upload via indelible, byte-for-byte readback (SHA256 match).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Nic-dorman Nic-dorman merged commit 71f9e0f into main Apr 28, 2026
3 checks passed
@Nic-dorman Nic-dorman deleted the fix/antd-prepare-upload-evm-config branch April 28, 2026 20:48
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