Background
The hardhat node used by examples/ethereum-basic-event-handlers/hardhat/ is built from a Dockerfile that runs pnpm install against a package.json with "hardhat": "^2.22.1" and no lockfile. Each CI build therefore picks up whatever matching version is latest on npm at that moment.
That bit us in CI run Ethereum Basic Event Handlers on the ci branch when the in-container hardhat resolved to 2.28.6. Hardhat ≥ 2.26 defaults to the Prague hardfork, which enforces EIP-7825's per-transaction gas cap of 2^24 = 16_777_216. The test contract deploy needs ~30M gas and gets rejected with:
ProviderError: Transaction gas limit is 30000000 and exceeds transaction gas cap of 16777216
Temporary workaround already in place
Commit e906ab36 pins the in-container hardhat network's hardfork to cancun, which is the last hardfork before EIP-7825 took effect:
// examples/ethereum-basic-event-handlers/hardhat/hardhat.config.js
networks: {
hardhat: { hardfork: 'cancun' },
},
This unblocks CI but is the wrong long-term fix: it freezes the example to pre-Prague EVM semantics, and the contract size / gas limit assumptions in the test fixtures will continue to drift from real Ethereum.
Proper fix (pick one)
- Pin hardhat exactly in
examples/ethereum-basic-event-handlers/hardhat/package.json ("hardhat": "2.28.6" or whichever known-good version) and add a lockfile committed to the repo so the Docker build is deterministic. Drop the hardfork: 'cancun' override.
- Lower the test contracts' deploy gas under the EIP-7825 cap (split deployments, slim down constructors, or use library linking) and let the example track the current hardfork. This is more invasive but keeps the example representative of mainnet.
- Bump the example to a hardhat 3.x baseline (3.4.5 is current) and audit the test for any breaking changes; same goal as option 2.
Option 1 is the smallest change and is probably what we want unless someone wants to use this example to demonstrate post-Prague behavior.
Acceptance criteria
Background
The hardhat node used by
examples/ethereum-basic-event-handlers/hardhat/is built from a Dockerfile that runspnpm installagainst apackage.jsonwith"hardhat": "^2.22.1"and no lockfile. Each CI build therefore picks up whatever matching version is latest on npm at that moment.That bit us in CI run
Ethereum Basic Event Handlerson thecibranch when the in-container hardhat resolved to 2.28.6. Hardhat ≥ 2.26 defaults to the Prague hardfork, which enforces EIP-7825's per-transaction gas cap of2^24 = 16_777_216. The test contract deploy needs ~30M gas and gets rejected with:Temporary workaround already in place
Commit
e906ab36pins the in-container hardhat network's hardfork tocancun, which is the last hardfork before EIP-7825 took effect:This unblocks CI but is the wrong long-term fix: it freezes the example to pre-Prague EVM semantics, and the contract size / gas limit assumptions in the test fixtures will continue to drift from real Ethereum.
Proper fix (pick one)
examples/ethereum-basic-event-handlers/hardhat/package.json("hardhat": "2.28.6"or whichever known-good version) and add a lockfile committed to the repo so the Docker build is deterministic. Drop thehardfork: 'cancun'override.Option 1 is the smallest change and is probably what we want unless someone wants to use this example to demonstrate post-Prague behavior.
Acceptance criteria
hardfork: 'cancun'override inexamples/ethereum-basic-event-handlers/hardhat/hardhat.config.jsis removed.Ethereum Basic Event HandlersCI job passes on a fresh CI runner.