Repository navigation
fix(taiko-client): run the integration tests against the PR's own protocol - #22142
Conversation
…tocol The integration tests deployed `taikoxyz/taiko-mono@main`'s contracts from a second checkout rather than the contracts in the pull request, so a change to the protocol could never be validated against the client in the same PR: the job tested different contracts on every re-run, and a protocol change that breaks the client only surfaced after it had merged. The taiko-client-rs workflow already deploys the PR's own `packages/protocol` for exactly this reason; do the same here, and trigger both workflows on the contracts and deploy script the tests actually run through `DeployProtocolOnL1`. Cover both ends of the `basefeeSharingPctg` range while we are here. The inbox accepts 0 to 100 inclusive, and taiko-geth splits a transaction's basefee as `gasUsed * baseFee * pctg / 100` to the coinbase with the remainder to the treasury, so 0 pays the coinbase nothing and 100 pays the treasury nothing. The client only ever plumbs the byte -- it does no arithmetic with it -- so the encoder is where the range is pinned: `EncodeShastaExtraData` had no test at all and now round-trips every boundary value through the decoder both clients rely on, asserts the percentage and proposal ID never read each other's bytes, and pins the three proposal IDs the encoder refuses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhqmeYDadT95CmcUhWzc2B
Listing only `contracts/` and `script/layer1/core/` missed part of what the integration tests actually build: `DeployProtocolOnL1` also imports `test/shared/DeployCapability.sol`, `test/shared/helpers/FreeMintERC20Token*` and `test/layer1/core/inbox/mocks/MockContracts.sol`. An enumerated list also goes stale the moment someone adds an import, which is the same silent gap this workflow set out to close. Use `protocol.yml`'s own paths instead — whatever can affect the protocol build can affect the contracts these tests deploy. `deployments/` stays excluded because `deploy_l1.json` is generated by the run rather than read into it. Also act on the review of the encoder tests: cover the whole accepted range 0..100 rather than six sampled values, so the helper's name matches what it returns; name each case with `t.Run` so a failure identifies itself; and fix a comment that elided its own verb. Reported by the deepseek-review bot on the pull request. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhqmeYDadT95CmcUhWzc2B
|
Took four of the five findings, pushed in f5f3e40. Warning 1 — path filters narrower than what the tests consume. Correct, and worse than reported. Traced the closure: Rather than extend the list to The cost is real and worth stating: the client integration lanes will now run on most protocol PRs. That is a deliberate trade of CI minutes for a failure mode that is loud instead of silent — happy to narrow it if the team would rather not pay that. Suggestion — Suggestion — the truncated comment. Fixed. "at 100 the treasury is" now reads "at 100 the treasury is paid nothing". Suggestion — Warning 2 — Generated by Claude Code |
🐋 DeepSeek Code Review🟡 Warnings
🔵 Suggestions
🟢 What Looks Good
Automatically triggered on PR update • model: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted filesContinue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
The bug
taiko-client--test.ymlran its integration tests against contracts from a second checkout pinned tomain, not the contracts in the pull request:Two consequences. A protocol change could never be validated against the client in the same PR — it only surfaced after merging, in some unrelated PR's CI. And because
mainmoves, the job tested different contracts on every re-run, so a green result did not mean the same thing twice.taiko-client-rs--test.ymlalready deploys the PR's ownpackages/protocol, with a comment giving exactly this reasoning. This brings the Go workflow in line.What changed
taiko-client--test.yml— drop themain-pinned checkout andPROTOCOL_FORK_DIR; pointPROTOCOL_DIRat${{ github.workspace }}/packages/protocol, which the job already has checked out.packages/protocol/contracts/**andpackages/protocol/script/layer1/core/**. These are what the tests deploy throughDeployProtocolOnL1, so a change to them can break the client without touching a single client file. Without this the fix above would still never fire on a protocol-only change.bindings/encoding/input_test.go(new) — boundary coverage forbasefeeSharingPctg.basefeeSharingPctg at 0 and 100
The inbox accepts
0 <= basefeeSharingPctg <= 100(LibInboxSetup.validateConfig), and taiko-geth splits each transaction's basefee asgasUsed * baseFee * pctg / 100to the coinbase with the remainder to the treasury. So 0 pays the coinbase nothing and 100 pays the treasury nothing — both ends are reachable configurations, not edge cases.The client itself is already indifferent: it only plumbs the byte into
extraDataand never does arithmetic with it. The exposure was entirely in tests that assumed a split.EncodeShastaExtraDatahad no test at all, so this adds three:{0, 1, 25, 75, 99, 100}round-trips throughcore.DecodeShastaBasefeeSharingPctg;uint48proposal ID;Interaction with #22127
#22127 moves
DevnetInboxtobasefeeSharingPctg: 100and makes the two treasury integration tests derive their expectation from the inbox config rather than assuming the treasury always gains. The two PRs compose in either merge order: onmaintoday the devnet inbox is still 75, so these tests pass unchanged here; once #22127 lands, the integration suite deploys and exercises 100 end to end for the first time.Testing
go test ./bindings/encoding/andgo vet ./bindings/encoding/pass locally; both workflow files parse as YAML. The integration lanes on this PR are the real check for the workflow change — they should now deploy this branch's contracts rather thanmain's.🤖 Generated with Claude Code
https://claude.ai/code/session_01UhqmeYDadT95CmcUhWzc2B
Generated by Claude Code