Skip to content

[PT1-867] Fix/optimize workflow - #198

Draft
axdvdv wants to merge 5 commits into
mainfrom
fix/optimize-workflow
Draft

axdvdv wants to merge 5 commits into
mainfrom
fix/optimize-workflow

Conversation

@axdvdv

@axdvdv axdvdv commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Change Summary

What does this PR change?

Related Issue/Ticket:

Testing & Verification

How was this tested?

  • Unit tests
  • Integration tests
  • Manual testing (describe steps)
  • Verified on staging

Risk Assessment

Risk Level:

  • Low - Minor changes, no operational impact
  • Medium - Moderate changes, limited impact, standard rollback available
  • High - Significant changes, potential operational impact, complex rollback

Risks & Impact


Note

Low Risk
Changes are confined to CI, Hardhat config, and test harness code; production contract logic is not modified in this diff.

Overview
Speeds up local and CI test runs by compiling Solidity tests with a new fast Hardhat profile (minimal optimizer settings, non-isolated compilation) while keeping the default profile for production-style builds. yarn test now uses --build-profile fast; CI splits into parallel test and snapshot jobs, adds Hardhat artifact caching on the test job, and runs gas snapshot checks only in the snapshot job.

Solidity tests are refactored to compile faster and stay slimmer: routers and mocks deploy via DeployCode / TraitsHelper in SwapVMTestSetup.sol instead of new on contracts imported from contracts/, and most suites drop OpcodesDebug inheritance (only true VM dispatchers keep it). Maker/taker packing goes through the helper with reduced MakerTraitsLibArgs / TakerTraitsLibArgs surface area; assertions that referenced SwapVM errors/events now target SwapVMRouter. Foundry test docs in .cursor/rules/foundry-tests.mdc are updated to match.

Aqua base tests pass explicit takerData into swap where the helper API changed.

Reviewed by Cursor Bugbot for commit 6ac7e63. Bugbot is set up for automated code reviews on this repo. Configure here.

- Updated Hardhat compiler settings for improved optimization and added details for Yul.
- Changed default compiler profile to use fastTestCompiler.
- Modified snapshot commands in package.json to specify the production build profile.
- Refactored CI workflow: renamed job from 'run-ci' to 'test', added caching for Hardhat artifacts, and created a separate job for snapshot checks.
- Updated test contracts to remove direct dependencies on MakerTraitsLib and TakerTraitsLib, replacing them with DeployCode and TraitsHelper for order creation.
- Simplified order creation logic across multiple test files, enhancing maintainability and readability.
- Adjusted inheritance in test contracts to remove OpcodesDebug where unnecessary.
@axdvdv axdvdv changed the title Fix/optimize workflow [PT1-867] Fix/optimize workflow Sep 11, 2026
Comment thread hardhat.config.ts Outdated
splitTestsCompilation: true,
profiles: {
default: { compilers: [swapVmCompiler] },
default: { compilers: [fastTestCompiler] },

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.

Feels like change of default might lead to unexpected consequences
Maybe create new profile aka fast and use it in yarn test script?

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 6ac7e63. Configure here.

Comment thread hardhat.config.ts
profiles: {
default: { compilers: [swapVmCompiler] },
production: { compilers: [swapVmCompiler] },
fast: { compilers: [fastTestCompiler] },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Production profile removed but still used

High Severity

The production Solidity profile is gone, but yarn build:production still passes --build-profile production. Hardhat 3 treats production as a built-in profile and Ignition compiles against it on deploy, so that path now either fails or uses Hardhat’s implicit optimizer/viaIR/preferWasm defaults instead of swapVmCompiler.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6ac7e63. Configure here.

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