Repository navigation
feat!: Publish test contracts apart from the rest; bump to 6.1.1 - #1623
Conversation
6.1.0 stopped publishing the contracts of dependencies, among them ERC1967Proxy. The sdk's test fixtures deploy each SpokePool behind it, and those fixtures are used downstream too, so every consumer would have had to find the proxy for itself. exportEvmArtifacts.sh now takes a list of dependency contracts to publish as well, each named by its source file. ERC1967Proxy is the only one, from OpenZeppelin v4: the proxy DeploymentUtils.sol deploys each SpokePool behind. Before 6.1.0 the v5 one was published, chosen by Foundry's layout. The script fails if a source in the list was not compiled. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Paul <108695806+pxrl@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
droplet-rl
left a comment
There was a problem hiding this comment.
LGTM. I ran the new exportEvmArtifacts.sh against this PR's CI forge build output (the out/ uploaded by run 47105672669):
- Both proxies get compiled.
out/ERC1967Proxy.sol/is v5 andout/ERC1967/ERC1967Proxy.sol/is v4. Only the v4 one gets published, and its compilationTarget key matchesEXTRA_SOURCESexactly. Result:Exported 238 ABIs and 142 bytecode files ... filtered 348. - The published
evm/abi/ERC1967Proxy.jsonis the v4 ABI: constructor(_logic, _data),receive, and theAdminChanged/BeaconUpgraded/Upgradedevents.evm/bin/ERC1967Proxy.binis 0x-prefixed creation code from the same build asDeploymentUtils.sol, so the fixtures now deploy the same proxy we deploy in production. - The missing-source guard isn't just theoretical. The v4 proxy is also pulled in by
contracts/tron/TronImports.sol, so a--skip scriptbuild would still compile it. The guard is still the right backstop for when those imports change.
For consumers: 6.0.x shipped the v5 proxy, which has custom errors, no receive, and no AdminChanged/BeaconUpgraded events. The sdk's deployUupsProxy deploys positionally (deploy(impl.address, initData)), so v4 works there without changes. Separately, sdk's getAcrossContractsArtifact still reads dist/evm/artifacts/<X>.sol/<X>.json (sdk is pinned to 6.0.0). It will need to read evm/abi + evm/bin before it bumps to 6.1.x. That's sdk work, not something for this PR.
I didn't wait for the pending EVM Tests / SVM package jobs, and I didn't run test-svm-idl-package locally. One non-blocking test suggestion is inline.
The export script named OpenZeppelin's proxy by its path under node_modules, as an exception to publishing only what is declared under contracts/. That put a dependency's file layout into a shell script. Declare the proxy in contracts/test instead, inheriting OpenZeppelin's v4 one through an import, so that it is published as one of the package's own contracts and the script needs no exception. It is still published as ERC1967Proxy. The file is SpokePoolProxy.sol, not ERC1967Proxy.sol, so that it does not displace OpenZeppelin's artifacts in Foundry's output. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Paul <108695806+pxrl@users.noreply.github.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
droplet-rl
left a comment
There was a problem hiding this comment.
LGTM. This is simpler than the EXTRA_SOURCES approach: exportEvmArtifacts.sh is unchanged from master, and the proxy is published under the same rule as every other contract.
What I verified:
- It compiles. I compiled
contracts/test/SpokePoolProxy.solon its own against@openzeppelin/contracts@4.9.6, using the default profile's settings (0.8.30, via-ir, 800 runs, prague). The ABI is v4's: constructor,fallback,receive, and theAdminChanged/BeaconUpgraded/Upgradedevents. The compilationTarget iscontracts/test/SpokePoolProxy.sol, and the artifact lands atout/SpokePoolProxy.sol/ERC1967Proxy.json, so OZ's v4 (out/ERC1967/ERC1967Proxy.sol/) and v5 (out/ERC1967Proxy.sol/) artifacts stay where they are. That matters for the tron scripts, although they readout-tronanyway. - The export works. I added that artifact to the CI
forge buildoutput from the previous run and ran the unchanged export script:Exported 238 ABIs ... filtered 349. No duplicate-name error, because both OZ proxies are filtered, andevm/abi/ERC1967Proxy.json+evm/bin/ERC1967Proxy.binare this contract's. - The extra
ERC1967Proxyin the default build is harmless. Nothing inscript/ortest/looks a proxy up by name (DeploymentUtils.solusesnew). Broadcast parsing (ExtractDeployedFoundryAddresses.ts,DeploySP1HeliosAndUniversalSpokePool.s.sol) keys oncontractName, which isERC1967Proxywhichever artifact Foundry matches. The zksync profile skipscontracts/test/**, and the tron and counterfactual profiles don't include it in theirsrc. - The package test now checks for
AdminChanged, which pins v4 over v5.
Not checked: the full forge build, the Lint job (prettier/solhint on the new file; the empty constructor body can trigger no-empty-blocks, which is a warning under solhint:recommended), and test-svm-idl-package. Those CI jobs were still pending when I reviewed. One wording nit is inline.
Everything declared under contracts/ was published into evm/abi and evm/bin, mocks beside the contracts that are deployed in production. With a test proxy now published as ERC1967Proxy, one of them carries the name of a contract that is deployed in production, and nothing in its path said otherwise. Contracts declared under contracts/test/ now go to evm/test/abi and evm/test/bin. A name is published in one of the two places and never both: exportEvmArtifacts.sh fails if a test contract and another share one. BREAKING CHANGE: the 43 contracts declared under contracts/test/, such as MockSpokePool and MerkleLibTest, move from evm/abi and evm/bin to evm/test/abi and evm/test/bin. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Paul <108695806+pxrl@users.noreply.github.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
droplet-rl
left a comment
There was a problem hiding this comment.
LGTM. Putting test contracts under their own path is a good change, and it gives the test ERC1967Proxy a sensible home. I have two non-blocking notes, both inline.
What I verified, running this branch's exportEvmArtifacts.sh against the CI forge build output from this PR's first commit (same master base, without the new proxy):
- It succeeds:
Exported 237 ABIs and 141 bytecode files to evm (41 of the ABIs to evm/test), skipped 103, filtered 349. No name collides across the two directories, so the new "never both" check passes on today's tree. - The check works in both directions. Whichever of a test contract and a non-test contract is processed first, the second one finds the other's ABI file and fails. Checking only
abi/is enough, because every exported contract has an ABI file. evm/test/holds exactly thecontracts/test/**sources: the mocks, plus helpers declared in mock files such asInbox,L2GatewayRouter,Permit2EIP712,SignatureVerification,MintableERC20andIHyperCoreFlowExecutor.files,exports, the IdlPackage allowlist regex and the consumer assertions all coverevm/test/{abi,bin}. The consumer test also asserts thatMockSpokePoolandERC1967Proxyare absent fromevm/abi/evm/bin.- "Nothing has adopted 6.1.0" holds for the repos I checked. On npm, 6.1.0 has been
latestsince 2026-12-03 12:03 UTC. relayer (5.1.0), sdk (6.0.0) and frontend (5.0.26) all pin exact versions. The indexer doesn't depend on the package.
A small release-notes point: I count 41 contracts moving from evm/abi to evm/test/abi, which makes 42 under evm/test/ with the new proxy. The description says 43. Worth a recount before this goes into the changelog.
Not checked: the full CI run on this head (EVM Tests, Lint, test-svm-idl-package were pending), and the export with SpokePoolProxy.sol in a real full build. I checked that file on its own in the previous round.
| abi_file="$ABI_DIR/$contract.json" | ||
| bin_file="$BIN_DIR/$contract.bin" | ||
| case "$source" in | ||
| "$TEST_SRC_DIR"/*) dir="$TEST_ARTIFACT_DIR"; other_dir="$ARTIFACT_DIR" ;; |
There was a problem hiding this comment.
Non-blocking: the split goes by directory, so two test-only contracts outside contracts/test/ stay in evm/abi, next to production contracts:
contracts/chain-adapters/Mock_Adapter.sol. The sdk's HubPool fixtures deploy it (getContractFactory("Mock_Adapter"), 4 call sites), and it doesn't appear inbroadcast/.contracts/external/uma/.../Timer.sol("for testing environments"). This one is vendored UMA code, so it's fine to leave it.
So the description's "evm/abi: contracts deployed in production" overstates it slightly. The README is careful ("Nothing under evm/test/ is deployed in production"), so this is about the PR framing, not the docs. If you want Mock_Adapter on the test side, this breaking release is the cheapest time: move the file to contracts/test/ and update 7 importers. The sdk reader will look in both places, so moving it later wouldn't break the sdk either. Fine as a follow-up.
There was a problem hiding this comment.
Moved in 211f552: Mock_Adapter.sol is now in contracts/test/, with its seven importers updated, so Mock_Adapter and Mock_Bridge publish under evm/test/. Timer stays: HubPool inherits Testable, which imports it, so moving it would change the metadata of HubPool's bytecode.
The description no longer calls evm/abi the production contracts, and its count is corrected: your 41, plus these two.
Mock_Adapter and Mock_Bridge are used only by tests, but were declared beside the chain adapters, so they were published among the contracts that are deployed in production. Under contracts/test they are published with the other test contracts, in evm/test. UMA's Timer is also for tests alone, and stays where it is: HubPool inherits Testable, which imports it, so moving it would change the metadata of HubPool's bytecode. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Paul <108695806+pxrl@users.noreply.github.com>
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
droplet-rl
left a comment
There was a problem hiding this comment.
LGTM. 211f552 addresses both of my earlier points. Mock_Adapter/Mock_Bridge now publish under evm/test/, and the reasoning for keeping Timer is correct: HubPool imports Testable.sol, which imports Timer.sol, so moving it would change the source paths in HubPool's metadata.
What I verified:
- Full build. I downloaded the full
forge buildfrom run 47110383443 (head b5faea7, all CI green), which includesout/SpokePoolProxy.sol/ERC1967Proxy.json. I edited theMock_Adapter.solartifacts' compilationTarget tocontracts/test/Mock_Adapter.sol, the only thing 211f552 changes for export, and ran this head'sexportEvmArtifacts.sh:Exported 238 ABIs and 142 bytecode files to evm (44 of the ABIs to evm/test). - Counts. 44 under
evm/test/= 43 moved + the newERC1967Proxy, which matches the "43 by the count on this PR's CI build" in the description. My earlier 41 didn't includeMock_Adapter/Mock_Bridge. - What's left in
evm/abi. Nothing namedMock*and noERC1967Proxy.Timeris the only test-only contract there, as described. - The move. Pure rename plus the relative import (
../chain-adapters/interfaces/AdapterInterface.solexists). All seven foundry importers are updated and no other path references remain. The hits indeployments/*/solcInputsare historical hardhat inputs, not deployments, and there's noMock_Adapterinbroadcast/ordeployments/. Nothing in production imports it, so no production bytecode metadata changes.
Not checked: EVM Tests and the SVM jobs were still pending on 211f552 (Lint passed). I didn't compile the moved imports locally; EVM Tests will cover that.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 211f552486
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Three suites fork the public Hyperliquid RPC at its latest block in setUp. Now and then the fork fails with "invalid block height": the RPC is served by more than one node, and the one asked for the latest block had not yet received it. The block rejected on #1623 carries the timestamp of the second the tests ran in. That has failed EVM Tests on unrelated pull requests, twice in one day. Ask for the latest block number and fork ten blocks before it. Blocks come about a second apart, so every node has a block that old. The tests still fail if the RPC is down. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Paul <108695806+pxrl@users.noreply.github.com>
…#1624) Stops a flaky failure in "EVM Tests" that has hit unrelated pull requests twice in one day (#1622 and #1623). The failure. Three suites (HyperCoreFlowExecutorTest, CCTPDirectFlowTest, SponsoredCCTPDstPeripheryTest) share a setUp that forks the public Hyperliquid RPC at its latest block. Now and then the fork fails: vm.createSelectFork: ... error code -32603: invalid block height: 52914819 The RPC is served by more than one node. A fork asks for the latest block number and then for that block, and the node that got the second request had not yet received it. The block rejected on #1623 carries the timestamp of the second the tests ran in. The fix. setUp asks for the latest block number and forks ten blocks before it. Blocks come about a second apart, so every node has a block that old. - One file: test/evm/foundry/local/external/hyper-evm-lib/test/BaseSimulatorTest.sol. It is vendored, so this diverges from upstream. - The tests still fail if the RPC is down. - The failure could not be reproduced on demand, so this is reasoned from the error and the block's timestamp, not measured. --------- Signed-off-by: Paul <108695806+pxrl@users.noreply.github.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
droplet-rl
left a comment
There was a problem hiding this comment.
LGTM. 3902f97 only merges master (#1624, the Hyperliquid fork fix). git diff origin/master HEAD is byte-identical to the diff I approved at 211f552.
New since my last review:
- Real build, no simulation. I ran
exportEvmArtifacts.shon this head's own CIforge build(run 47129151038).Mock_Adapter's compilationTarget is now actuallycontracts/test/Mock_Adapter.sol, so I didn't have to simulate the move. Output:Exported 238 ABIs and 142 bytecode files to evm (44 of the ABIs to evm/test).ERC1967Proxy,Mock_AdapterandMock_Bridgeare inevm/test/abi, andTimeris the only test-only contract left inevm/abi, as described. - Moved imports compile. EVM Tests on 211f552 ran 718 tests and passed them, including all seven suites whose
Mock_Adapterimport moved (BondToken_E2E,HubPool_Admin/ExecuteRootBundle/LiquidityProvisionFees/LiquidityProvisionHaircut/PooledTokenSynchronization/ProtocolFees). The only two failures were the Hyperliquidvm.createSelectFork"invalid block height" setUp errors inHyperCoreFlowExecutor.t.solandSponsoredDirectFlow.t.sol, which #1624 addresses.
Not checked: EVM Tests, Build TypeScript and the SVM jobs were still pending on 3902f97 (Lint passed).
Publishes test contracts apart from the rest, and bumps the version to 6.1.1.
MockSpokePoolno longer sit besideHubPool. A name is published in one of the two places and never both; the export script fails otherwise.Mock_Adapter.solmoves intocontracts/test/. UMA'sTimerstays:HubPoolimports it throughTestable, so moving it would changeHubPool's bytecode metadata.ERC1967Proxyis published again, as a test contract. 6.1.0 dropped it with the other dependency contracts, and the sdk's fixtures deploy each SpokePool behind it. It is declared incontracts/test/SpokePoolProxy.soland inherits OpenZeppelin's v4 proxy; its bytecode is not that of a proxy deployed byDeploymentUtils.sol.Breaking: 43 contracts move from
evm/abiandevm/bintoevm/test/. 6.1.0 was published today and nothing has adopted it.🤖 Generated with Claude Code