Skip to content

feat!: Publish test contracts apart from the rest; bump to 6.1.1 - #1623

Merged
pxrl merged 5 commits into
masterfrom
pxrl/exportProxy
Dec 3, 2026
Merged

pxrl merged 5 commits into
masterfrom
pxrl/exportProxy

Conversation

@pxrl

@pxrl pxrl commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Publishes test contracts apart from the rest, and bumps the version to 6.1.1.

evm/test/abi/<Contract>.json   evm/test/bin/<Contract>.bin    contracts declared under contracts/test/
evm/abi/<Contract>.json        evm/bin/<Contract>.bin         everything else
  • Test contracts move. Mocks such as MockSpokePool no longer sit beside HubPool. A name is published in one of the two places and never both; the export script fails otherwise.
  • Mock_Adapter.sol moves into contracts/test/. UMA's Timer stays: HubPool imports it through Testable, so moving it would change HubPool's bytecode metadata.
  • ERC1967Proxy is 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 in contracts/test/SpokePoolProxy.sol and inherits OpenZeppelin's v4 proxy; its bytecode is not that of a proxy deployed by DeploymentUtils.sol.

Breaking: 43 contracts move from evm/abi and evm/bin to evm/test/. 6.1.0 was published today and nothing has adopted it.

🤖 Generated with Claude Code

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T14:42:18.548283Z 3902f97 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pxrl
pxrl requested a review from droplet-rl December 3, 2026 12:27
droplet-rl
droplet-rl previously approved these changes Dec 3, 2026

@droplet-rl droplet-rl left a comment

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.

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 and out/ERC1967/ERC1967Proxy.sol/ is v4. Only the v4 one gets published, and its compilationTarget key matches EXTRA_SOURCES exactly. Result: Exported 238 ABIs and 142 bytecode files ... filtered 348.
  • The published evm/abi/ERC1967Proxy.json is the v4 ABI: constructor (_logic, _data), receive, and the AdminChanged/BeaconUpgraded/Upgraded events. evm/bin/ERC1967Proxy.bin is 0x-prefixed creation code from the same build as DeploymentUtils.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 script build 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.

Comment thread test/fixtures/svm-idl-consumer.cjs Resolved
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>
@pxrl

pxrl commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 113738a3fa

ℹ️ 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".

droplet-rl
droplet-rl previously approved these changes Dec 3, 2026

@droplet-rl droplet-rl left a comment

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.

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.sol on 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 the AdminChanged/BeaconUpgraded/Upgraded events. The compilationTarget is contracts/test/SpokePoolProxy.sol, and the artifact lands at out/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 read out-tron anyway.
  • The export works. I added that artifact to the CI forge build output 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, and evm/abi/ERC1967Proxy.json + evm/bin/ERC1967Proxy.bin are this contract's.
  • The extra ERC1967Proxy in the default build is harmless. Nothing in script/ or test/ looks a proxy up by name (DeploymentUtils.sol uses new). Broadcast parsing (ExtractDeployedFoundryAddresses.ts, DeploySP1HeliosAndUniversalSpokePool.s.sol) keys on contractName, which is ERC1967Proxy whichever artifact Foundry matches. The zksync profile skips contracts/test/**, and the tron and counterfactual profiles don't include it in their src.
  • 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.

Comment thread README.md Resolved
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>
@pxrl pxrl changed the title fix: Publish ERC1967Proxy again; bump to 6.1.1 feat!: Publish test contracts apart from the rest; bump to 6.1.1 Dec 3, 2026
@pxrl
pxrl requested a review from droplet-rl December 3, 2026 12:55
@pxrl

pxrl commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: b5faea7912

ℹ️ 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".

droplet-rl
droplet-rl previously approved these changes Dec 3, 2026

@droplet-rl droplet-rl left a comment

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.

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 the contracts/test/** sources: the mocks, plus helpers declared in mock files such as Inbox, L2GatewayRouter, Permit2EIP712, SignatureVerification, MintableERC20 and IHyperCoreFlowExecutor.
  • files, exports, the IdlPackage allowlist regex and the consumer assertions all cover evm/test/{abi,bin}. The consumer test also asserts that MockSpokePool and ERC1967Proxy are absent from evm/abi/evm/bin.
  • "Nothing has adopted 6.1.0" holds for the repos I checked. On npm, 6.1.0 has been latest since 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" ;;

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.

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 in broadcast/.
  • 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.

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 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.

Comment thread package.json Resolved
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>
@pxrl

pxrl commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ 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".

@pxrl

pxrl commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@droplet-rl droplet-rl left a comment

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.

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 build from run 47110383443 (head b5faea7, all CI green), which includes out/SpokePoolProxy.sol/ERC1967Proxy.json. I edited the Mock_Adapter.sol artifacts' compilationTarget to contracts/test/Mock_Adapter.sol, the only thing 211f552 changes for export, and ran this head's exportEvmArtifacts.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 new ERC1967Proxy, which matches the "43 by the count on this PR's CI build" in the description. My earlier 41 didn't include Mock_Adapter/Mock_Bridge.
  • What's left in evm/abi. Nothing named Mock* and no ERC1967Proxy. Timer is the only test-only contract there, as described.
  • The move. Pure rename plus the relative import (../chain-adapters/interfaces/AdapterInterface.sol exists). All seven foundry importers are updated and no other path references remain. The hits in deployments/*/solcInputs are historical hardhat inputs, not deployments, and there's no Mock_Adapter in broadcast/ or deployments/. 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread scripts/exportEvmArtifacts.sh Resolved
pxrl added a commit that referenced this pull request Dec 3, 2026
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>
pxrl added a commit that referenced this pull request Dec 3, 2026
…#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>
@pxrl
pxrl requested a review from droplet-rl December 3, 2026 14:40
@pxrl

pxrl commented Dec 3, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 3902f97f79

ℹ️ 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".

@droplet-rl droplet-rl left a comment

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.

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.sh on this head's own CI forge build (run 47129151038). Mock_Adapter's compilationTarget is now actually contracts/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_Adapter and Mock_Bridge are in evm/test/abi, and Timer is the only test-only contract left in evm/abi, as described.
  • Moved imports compile. EVM Tests on 211f552 ran 718 tests and passed them, including all seven suites whose Mock_Adapter import moved (BondToken_E2E, HubPool_Admin/ExecuteRootBundle/LiquidityProvisionFees/LiquidityProvisionHaircut/PooledTokenSynchronization/ProtocolFees). The only two failures were the Hyperliquid vm.createSelectFork "invalid block height" setUp errors in HyperCoreFlowExecutor.t.sol and SponsoredDirectFlow.t.sol, which #1624 addresses.

Not checked: EVM Tests, Build TypeScript and the SVM jobs were still pending on 3902f97 (Lint passed).

@pxrl
pxrl merged commit 8133bbf into master Dec 3, 2026
9 checks passed
@pxrl
pxrl deleted the pxrl/exportProxy branch December 3, 2026 14:57
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.

2 participants