Commit 6a383ae
feat: add anchor-evm crate for EVM-based anchoring (#742)
* feat: add anchor-evm crate for EVM-based anchoring
Add new crate implementing EVM blockchain anchoring for Ceramic streams.
- Supports self-anchoring directly to EVM chains without Merkle trees
- Implements gas management with dynamic pricing and retry logic
- Uses environment variables for RPC endpoints to avoid hardcoded secrets
- Includes comprehensive tests for Gnosis Chain integration
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(anchor-evm): address PR review comments and add full integration test
Fixes from PR #742 review:
- Fix tx_hash_to_cid: wrap hash with Keccak256 code + ETH_TX codec (0x93)
instead of re-hashing with SHA2-256
- Fix AnchorProof parameter order: (chain_id, root, tx_hash, tx_type)
- Add chain ID validation after connecting to provider
- Implement retry logic with exponential backoff
- Add wallet balance logging for gas cost tracking
- Update default confirmations from 1 to 4 (matching JS implementation)
Code cleanup:
- Remove unused GasConfig (alloy handles gas estimation automatically)
- Remove unused get_root_block function and getRootBlock interface
- Consolidate gnosis_test.rs into integration_test.rs
Testing:
- Add test_cid_to_bytes32_matches_js to verify JS compatibility
- Add test_tx_hash_to_cid_matches_js to verify JS compatibility
- Add test_anchor_service_with_evm for full AnchorService flow testing
(merkle tree building, EVM anchoring, time event creation)
Documentation:
- Update README with comprehensive test documentation
- Document all environment variables for integration tests
- Update contract interface to match actual implementation
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(anchor-evm): handle reverted transactions and missing block number
- Check receipt.status() and return error if transaction reverted
- Use ok_or_else() instead of unwrap() for block_number
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* chore: macOS-13 -> macos-15-intel
* review comment
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 48994b2 commit 6a383ae
11 files changed
Lines changed: 1339 additions & 4 deletions
File tree
- .github/workflows
- anchor-evm
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
0 commit comments