Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

feat: add Alien Base V3 substreams and integration tests for Base#376

Open
Haikane wants to merge 5 commits into
mainfrom
feat/alienbase-v3
Open

feat: add Alien Base V3 substreams and integration tests for Base#376
Haikane wants to merge 5 commits into
mainfrom
feat/alienbase-v3

Conversation

@Haikane
Copy link
Copy Markdown
Contributor

@Haikane Haikane commented Feb 19, 2026

Summary

  • Add base-alienbase-v3.yaml substreams config for Alien Base V3 on Base chain
  • Alien Base V3 is a stock Uniswap V3 fork (factory: 0x0Fd83557b2be93617c9C1C1B6fd549401C74558C, deployed block 7150708)
  • Reuses existing ethereum-uniswap-v3-logs-only WASM binary; only a new YAML config is needed

Verification

  • WASM compiles and .spkg packages successfully
  • Pool indexing verified via substreams run on Base mainnet:
    • ALB/WETH pool (0xbcd27a...) at block 8389471: fee=10000 (1%), tick_spacing=200 ✅
    • WETH/cbBTC pool (0x1d6cfe...) at block 34803135: fee=100 (0.01%), tick_spacing=2 ✅
  • Factory filtering correct (only Alien Base factory events captured)
  • Differential math test: swap outputs match on-chain exactly (0-2 wei rounding)

Related PRs

  • tycho-execution: propeller-heads/tycho-execution (feat/alienbase-v3) - encoder registration

Test plan

  • WASM compilation
  • .spkg packaging
  • substreams run map_pools_created on Base mainnet (2 pools verified)
  • Differential swap math verification (2 pools, exact match)
  • Full map_protocol_changes store backfill (production deployment step)

🤖 Generated with Claude Code

Alien Base V3 is a stock Uniswap V3 fork on Base (factory:
0x0Fd83557b2be93617c9C1C1B6fd549401C74558C, deployed at block
7150708). Core contracts are unmodified, so this reuses the existing
ethereum-uniswap-v3-logs-only WASM binary with a new YAML config.

Verified via substreams run on Base mainnet: pool creation events
indexed correctly for ALB/WETH and WETH/cbBTC pools with correct
static attributes (fee, tick_spacing, pool_address).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Haikane and others added 2 commits February 19, 2026 16:23
Add header comments documenting the factory address and deployment
block for easier auditability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Register alienbase_v3 in the protocol-testing framework:
- Clone mapping to reuse ethereum-uniswap-v3-logs-only substreams
- Integration test config for WETH/USDC fee-750 pool on Base
- Simulation state registry (UniswapV3State)
- Executor bytecode mapping (UniswapV3 executor)
- Fix hardcoded "ethereum" chain key in executors_json to use
  dynamic chain name (affects all non-Ethereum tests)

Dependencies temporarily point to feat/alienbase-v3 branches
for tycho-simulation and tycho-execution. Revert to pinned tags
once those PRs merge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Haikane Haikane changed the title Add Alien Base V3 substreams for Base feat: add Alien Base V3 substreams and integration tests for Base Feb 19, 2026
Comment thread protocol-testing/src/test_runner.rs Outdated
Comment on lines +1128 to +1129
let chain_model = ChainModel::from(self.chain);
let chain_key = self.chain.to_string().to_lowercase();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unnecessary

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved chain_model back to its original position (a461f59). The chain_key variable stays since it replaces the hardcoded "ethereum" key so the executors JSON works for Base chain too.

tempfile = "3.8.1"

[patch.crates-io]
tycho-execution = { git = "https://github.com/propeller-heads/tycho-execution.git", branch = "feat/alienbase-v3" }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't commit patches usually, for testing this is nice but we should probably try to get execution merged and use the latest tag. @dianacarvalho1 @tamaralipows what's the usual process here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the execution/simulation PRs are not merged, this is how it should be done to test! but yeah this needs to be changed before merging.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — will remove the [patch.crates-io] section once the execution PR (#335) is merged and update to the latest tag before merging this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update before merging.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the execution PR link is broken. it is this one

Comment thread substreams/ethereum-uniswap-v3-logs-only/integration_test_alienv3.tycho.yaml Outdated
Haikane and others added 2 commits February 20, 2026 19:26
Addresses review comment: the chain_model move was unnecessary.
The chain_key variable remains as it's needed to support Base chain
(replaces the hardcoded "ethereum" key in executors_json).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The generic UniswapV3 executor runtime has Ethereum's factory address
baked in as an immutable, causing InvalidTarget reverts for Alienbase
V3 pools on Base. Build a dedicated runtime with the correct factory
(0x0Fd83557) and init code hash. All 6 execution tests now pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants