fix: add withdrawal integration test and clear pre-existing lint debt#2
Merged
Conversation
Verifies the BoLD staker-switch-interval reduction (d41d5a9) actually lets withdrawals confirm quickly end-to-end. Drives ArbSys.withdrawEth on the child chain, builds an outbox proof via NodeInterface, polls until the assertion is confirmable, and executes on the parent. - Adds withdrawal executor (src/withdraw.ts) and vitest integration suite covering both L2 to L1 and L3 to L2 paths against a running local testnode (30s SLO). - Adds arbSys / nodeInterface / outbox ABIs to src/rpc.ts. - Isolates the integration run in vitest.integration.config.ts and excludes test/integration/** from the default pnpm test run so pnpm validate stays hermetic.
Brings pnpm lint back to zero errors so pnpm validate is green. - Refactor high-complexity functions into small helpers: clean.ts, init.ts, snapshot.ts, and the mocked execOrThrow implementation in test/token-bridge.test.ts. - Drop dead code orphaned by the docker-to-SDK deploy migration (30094b4): L2_DEPOSIT_VALUE and getErrorMessage in init.ts, L2_L3_FACTORY_GAS_LIMIT / runCompose / composeRunArgs in token-bridge.ts. - Replace a non-null assertion in snapshot.ts with an explicit undefined check. - Minor style fixes: useBlockStatements in chainForRpc, noUnusedTemplateLiteral in snapshot.ts. - Keep delete on process.env and nitro config-key removals where assigning undefined changes semantics; document each with a targeted biome-ignore. - Formatter-only touch-ups in scripts/action/run.mjs, fee-token.ts, sdk-chain.ts, and exec.test.ts required for biome check to pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ArbSys.withdrawEth, builds an outbox proof viaNodeInterface.constructOutboxProof, polls until the assertion is confirmable, and executes on the parent. Verifies the recent BoLD staker-switch-interval reduction (d41d5a9) actually delivers fast withdrawals end-to-end (30s SLO).vitest.integration.config.tsand excludestest/integration/**from the default test run sopnpm validateremains hermetic.pnpm validateis green again. Mostly mechanical (block statements, template-literal → string,delete→ biome-ignore where semantics require it) plus a few complexity refactors (clean.ts,init.ts,snapshot.ts,test/token-bridge.test.ts).L2_DEPOSIT_VALUE,getErrorMessage,L2_L3_FACTORY_GAS_LIMIT,runCompose,composeRunArgs.Test plan
pnpm lint— 0 errorspnpm typecheck— cleanpnpm build— cleanpnpm test:run— 128/128 passing;test/integration/**excludedpnpm vitest --config vitest.integration.config.tsagainst a livepnpm devtestnode — confirm both withdrawal cases close under 30s (requires local L1/L2/L3 running; run before merge)