feat: add Mellow meta core and earnUSDe configs across networks#148
feat: add Mellow meta core and earnUSDe configs across networks#148arwer13 wants to merge 43 commits into
Conversation
Add missing opcodes introduced in the Cancun/Dencun upgrade: - TLOAD (0x5C), TSTORE (0x5D) — transient storage (EIP-1153) - MCOPY (0x5E) — memory copy (EIP-5656) - BLOBHASH (0x49), BLOBBASEFEE (0x4A) — blob gas (EIP-4844, EIP-7516) Replace individual opcode tests with parametrized coverage of all 149 opcodes in the table, plus PUSH0..PUSH32 byte-length verification.
Add -C / --contract CLI option to filter which contracts are checked. Can be passed multiple times. Case-insensitive address matching. Usage: diffyscan config.yaml -C 0xAddr1 -C 0xAddr2
…s limit - Add rpc_url_env_var config field to specify chain-specific RPC env var (falls back to REMOTE_RPC_URL for backward compatibility) - Add -L / --local-rpc flag to override with LOCAL_RPC_URL (e.g. anvil) - Add deployment_gas_limit config field for chains with inflated gas costs (e.g. Mantle needs 30B gas for deployment simulation)
Add rpc_url_env_var, deployment_gas_limit (30B for Mantle's inflated gas), and full bytecode_comparison constructor_calldata for all contracts.
Add Arbitrum mainnet Mellow core config with all contract addresses, constructor calldata for bytecode comparison, and rpc_url_env_var. Known diff: RedeemQueue deployed from commit f164438c2d0d before shareManager_.burn() was added in later commits.
Move base meta configs to mainnet/ directory. Add full constructor calldata for bytecode comparison (shared CREATE2 addresses with Mantle). Add BurnableTokenizedShareManager missing from docs. Known diff: SyncDepositQueue deployed from commit 173e06c99f4f before immutable keyword was added to _syncDepositQueueStorageSlot.
Mellow redeployed on Arbitrum with deterministic CREATE2 addresses matching Mantle/Base. Update all contract addresses and constructor calldata accordingly. Only SwapModule has a unique Arbitrum address (0x00000000c324E2d1).
SyncDepositQueue on Base updated from 0x00000000c4Bf4fdF6... (old, pre-audit deployment without immutable fix) to 0x000000001CC8c3E40856E956db870095EF6C98bd (same as Mantle, matches audited commit c9c71818).
Add Plasma (chain ID 9745) Mellow core config with CREATE2 addresses. Contracts not yet verified on Etherscan v2 — config prepared for when verification becomes available. SwapModule address unique to Plasma: 0x00000000015fa996bCA8c842AFEdC334616F283A.
- eth/plasma SwapModule proxies -> redeployed addresses + ctor calldata - add missing ctor calldata for earnUSDe proxies (explorer returns empty) - drop orphaned AaveOracle wrapper (SwapModule now reads Aave oracle directly)
- replace all earnUSDe contract addresses with the new deployment - add SyncDepositQueue (USDe) - ctor calldata extracted from on-chain creation traces (CREATE2 proxies return empty args on Etherscan)
- replace 8 earnUSDe proxy addresses with the new Mantle deployment - ctor calldata extracted from on-chain creation traces - bump commented TimelockController address (still unverified on explorer)
- order contract groups to match the Ethereum earnUSDe config - enable TimelockController (relies on explorer ctor args, as on Ethereum)
- replace 5 core proxies + SwapModule + Subvault 0 / Verifier 0 - add Subvault 1 / Verifier 1 (new in this deploy) - switch ShareManager impl to BurnableTokenizedShareManager - add OracleSubmitter (unverified on explorer yet) and enable TimelockController - ctor calldata extracted from on-chain creation traces - reorder contract groups to match the Ethereum earnUSDe config
- replace all 8 proxy addresses with the new deployment - switch ShareManager impl to BurnableTokenizedShareManager - add OracleSubmitter and TimelockController (both unverified on explorer yet) - ctor calldata (proxies, OracleSubmitter, Timelock) from on-chain creation traces
No current Arbitrum earnUSDe deployment to track; meta_core_config stays.
A contract that can't be fetched/compared (e.g. unverified on the explorer) no longer aborts the whole run. It is logged, recorded in a new errored_contracts list, and processing continues with the next contract. Errored contracts are shown in the final summary and still cause a non-zero exit code, so they aren't masked as success.
Vault, DepositQueue, Oracle, TokenizedShareManager, FeeManager, RiskManager, Subvault, Verifier implementations had no constructor_calldata and the explorer returns empty args, so diffyscan couldn't simulate them and reported bytecode mismatches. Add their calldata (mirrors the shared implementations in meta_usd; TokenizedShareManager from creation trace). All 8 now fully match.
…andler Addresses Copilot review: - bytecode comparison errors (missing/bad calldata, compile/RPC failure) now abort the run instead of being silently downgraded to a mismatch; a plain bytecode mismatch still returns False and is reported as a diff - source/verification errors (e.g. unverified on explorer) stay non-fatal: logged, recorded, run continues - remove the now-dead ExceptionHandler / fail_on_bytecode_comparison_error mechanism (raise_exception_or_log was no longer called anywhere) from code, types, README, skills, tests and fixtures - errored-contract summary and log now include the config file path Note: the fail_on_bytecode_comparison_error key remains in config_samples as a harmless no-op (loader ignores unknown keys); cleaning those is left out of this PR to avoid a large unrelated diff.
Reverts the resilience fix (ea789f0) and the bytecode-error-fatal refactor (b756645). The fatal-on-bytecode-error behavior broke a valid case (eth_call revert during deploy simulation, previously reported as an allowed diff — hoodi_vaults_testnet regression). Error-handling will be reworked in a separate PR. earnUSDe configs and the Ethereum meta_core calldata fix (b93d6e1) are kept.
…ploy fix: earnUSDe re-deploy (Ethereum + Mantle + Plasma)
feat: mantle, arbitrum, base meta updates
- new-config: fail_on_bytecode_comparison_error defaults to true (not an opt-in 'strict mode'); document the rpc_url_env_var and deployment_gas_limit config keys that the code actually reads - debug-diff: BinVerifierError is caught in process_config and recorded as a non-match (match=False), it does not abort the run; quote the full 'Failed in binary comparison: ...' log line - CLAUDE.md: HTML diffs are saved under digest/<timestamp>/diffs/
Per Copilot review on #164: bytecode comparison errors are always caught and recorded as match=False; the flag actually controls whether a per-contract exception (e.g. explorer fetch/verify failure) aborts the run.
docs: fix AI-doc drift vs code
TheDZhon
left a comment
There was a problem hiding this comment.
👏 What a work done!
Pls consider favorably some small updates
| constructor_calldata: | ||
| # Implementations (CREATE2 via deterministic deployer) | ||
| "0x0000000070f44289ec5ea3E5972f058f75B29801": "00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000f429ba2a8437e7de85078cf7481e8ad52df7e58c000000000000000000000000e08dc488bd6756323f8bf478869529d03db627ef000000000000000000000000a64e324dff04e3c0613ff0706867868c7b370a450000000000000000000000009fbaf5aeb9f52ba57e1cc1d3050eac6d75df8ae700000000000000000000000000000000000000000000000000000000000000064d656c6c6f770000000000000000000000000000000000000000000000000000" # Vault | ||
| "0x0000000042E248f84Df6BA1E768F878b1f2Bae9f": "00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000009008d19f58aabd9ed0d60971565aa8510560ab41000000000000000000000000c92e8bdf79f0507f65a392b0ab4667716bfe011000000000000000000000000078c1b0c915c4faa5fffa6cabf0219da63d7f4cb800000000000000000000000000000000000000000000000000000000000000064d656c6c6f770000000000000000000000000000000000000000000000000000" # SwapModule |
There was a problem hiding this comment.
jic, https://mantlescan.xyz/address/0x9008d19f58aabd9ed0d60971565aa8510560ab41 and https://mantlescan.xyz/address/0xc92e8bdf79f0507f65a392b0ab4667716bfe0110 both are not deployed on Mantle for CoW
There was a problem hiding this comment.
Pull request overview
Adds new Mellow Meta Vault configuration samples (meta_core + earnUSDe) across multiple networks, and extends diffyscan tooling to (a) filter runs by specific contract addresses and (b) support chain-specific RPC env vars and configurable deployment simulation gas limits.
Changes:
- Add
--contract/-Cfiltering to only verify selected contract addresses, with a non-zero exit when the filter matches nothing. - Make bytecode simulation more configurable via
rpc_url_env_varanddeployment_gas_limit, and expand opcode parsing coverage (Cancun opcodes) with additional tests. - Add/adjust multi-network config samples (Plasma/Mantle/Base/Ethereum) including extensive
constructor_calldatafor CREATE2 deployments and proxies.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_contract_filter.py | New unit tests for --contract/-C filter behavior (case-insensitive matching, match-any-config semantics). |
| tests/test_bytecode_metadata.py | Adds tests asserting default/custom gas limit propagation into deployment simulation RPC payload. |
| tests/test_binary_verifier.py | Expands tests to cover opcode parsing via parse() and PUSH length handling. |
| README.md | Documents --contract/-C usage. |
| diffyscan/utils/node_handler.py | Renames default deployment gas constant and adds gas_limit parameter to simulate_deployment. |
| diffyscan/utils/constants.py | Adds Cancun opcodes (BLOB*, TLOAD/TSTORE/MCOPY) to the opcode table. |
| diffyscan/diffyscan.py | Adds --contract/-C, tracks matched count, supports rpc_url_env_var, and passes optional deployment_gas_limit into simulation. |
| config_samples/plasma/mainnet/meta/meta_usde_plasma_config.yaml | New Plasma earnUSDe config sample with constructor calldata for impls/proxies + governance contracts. |
| config_samples/plasma/mainnet/meta/meta_core_config.yaml | New Plasma meta_core config sample with constructor calldata for core components. |
| config_samples/mantle/mainnet/meta/meta_usde_mantle_config.yaml | New Mantle earnUSDe config sample; includes deployment_gas_limit. |
| config_samples/mantle/mainnet/meta/meta_core_config.yaml | New Mantle meta_core config sample; includes deployment_gas_limit. |
| config_samples/ethereum/mainnet/meta/meta_usd_config.yaml | Extends Ethereum meta_usd config with earnUSDe addresses + adds Aave dependency + proxy constructor calldata. |
| config_samples/ethereum/mainnet/meta/meta_core_config.yaml | Adds missing constructor calldata for shared core implementations on Ethereum. |
| config_samples/base/mainnet/meta/meta_usdc_base_config.yaml | Adds rpc_url_env_var for Base. |
| config_samples/base/mainnet/meta/meta_core_config.yaml | New Base meta_core config sample. |
| CLAUDE.md | Updates digest output path description to include timestamped subdir. |
| .env.example | Updates RPC env var examples to include per-chain RPC URLs and removes unused entries. |
| .claude/skills/new-config/SKILL.md | Documents new config knobs (rpc_url_env_var, deployment_gas_limit) and adds detailed constructor-calldata extraction guidance. |
| .claude/skills/debug-diff/SKILL.md | Updates troubleshooting guidance for binary comparison behavior and common error messages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| """Simulate contract deployment via eth_call and return deployed runtime bytecode.""" | ||
| logger.info(f'Simulating deployment via eth_call on "{mask_text(rpc_url)}" ...') | ||
|
|
Adds Mellow Meta Vault core and earnUSDe configs across networks, plus supporting tooling and tests. Targets
main.Mellow
meta_coreconfigs (core implementations & factories)meta_core_config.yamlfor Mantle, Plasma, Arbitrum, Base.meta_core: add missingconstructor_calldatafor 8 implementations (Vault, DepositQueue, Oracle, TokenizedShareManager, FeeManager, RiskManager, Subvault, Verifier) — explorer returns empty args for these CREATE2 deploys, so they previously showed false bytecode mismatches; all 8 now fully match.meta_usdcconfig undermainnet/for consistency.earnUSDe (Experimental) configs
Proxy / OracleSubmitter / Timelock constructor calldata extracted from on-chain creation traces (CREATE2 ⇒ empty args on explorers):
meta_usd_config.yaml): earnUSDe addresses for the new deployment; addSyncDepositQueue (USDe).meta_usde_mantle_config.yaml): full earnUSDe set; ShareManager impl isBurnableTokenizedShareManager; includes OracleSubmitter + TimelockController.meta_usde_plasma_config.yaml): full earnUSDe set incl. Subvault 0/1 and Verifier 0/1; ShareManager impl isBurnableTokenizedShareManager; includes OracleSubmitter + TimelockController.Tooling & tests
diffyscan.py:--contract/-Cfilter to verify specific addresses; related summary/handling tweaks.node_handler.py/constants.pyadjustments.--contractfilter, bytecode-metadata trimming, expanded binary-verifier coverage.Docs
.env.example, and.claudeskills (debug-diff, new-config) updates.Verification
diffyscan run across all touched networks: sources identical; verified non-proxy contracts (impls, Timelock, OracleSubmitter) match byte-for-byte;
TransparentUpgradeableProxyinstances differ only on the immutable ProxyAdmin reference (expected, since the ProxyAdmin address can't be reproduced by eth_call simulation).