Skip to content

cannon: Support feature toggles#15409

Merged
ajsutton merged 11 commits intodevelopfrom
aj/cannon-feature-toggles
Apr 16, 2025
Merged

cannon: Support feature toggles#15409
ajsutton merged 11 commits intodevelopfrom
aj/cannon-feature-toggles

Conversation

@ajsutton
Copy link
Contributor

Description

Introduces support for feature toggling cannon STF based on the state version. Only implements the go side of this currently and there are no features using toggles currently (#15408 shows how this would be used).

This also fully embraces the idea of their being more than one supported version (which is already true but currently there's only one supported version per "type").

Tests

Updated most tests to run over all supported versions rather than just the latest.

@codecov
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

Attention: Patch coverage is 76.38889% with 17 lines in your changes missing coverage. Please review.

Project coverage is 43.69%. Comparing base (11ace4c) to head (5879876).
Report is 11 commits behind head on develop.

Files with missing lines Patch % Lines
cannon/mipsevm/tests/helpers.go 83.33% 5 Missing ⚠️
cannon/cmd/load_elf.go 0.00% 4 Missing ⚠️
cannon/mipsevm/versions/state.go 84.61% 4 Missing ⚠️
cannon/mipsevm/multithreaded/state.go 0.00% 2 Missing ⚠️
cannon/mipsevm/program/testutil/mocks.go 0.00% 1 Missing ⚠️
cannon/mipsevm/singlethreaded/state.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #15409      +/-   ##
===========================================
- Coverage    46.48%   43.69%   -2.80%     
===========================================
  Files         1250     1137     -113     
  Lines       103813    98307    -5506     
===========================================
- Hits         48262    42957    -5305     
+ Misses       52159    51971     -188     
+ Partials      3392     3379      -13     
Flag Coverage Δ
cannon-go-tests-32 62.18% <63.88%> (-1.81%) ⬇️
cannon-go-tests-64 57.42% <55.55%> (-1.26%) ⬇️
contracts-bedrock-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cannon/mipsevm/multithreaded/instrumented.go 60.75% <100.00%> (-4.63%) ⬇️
cannon/mipsevm/versions/version.go 80.00% <100.00%> (ø)
cannon/mipsevm/program/testutil/mocks.go 46.66% <0.00%> (ø)
cannon/mipsevm/singlethreaded/state.go 55.88% <0.00%> (ø)
cannon/mipsevm/multithreaded/state.go 55.13% <0.00%> (ø)
cannon/cmd/load_elf.go 0.00% <0.00%> (ø)
cannon/mipsevm/versions/state.go 59.79% <84.61%> (+10.38%) ⬆️
cannon/mipsevm/tests/helpers.go 83.50% <83.33%> (-12.01%) ⬇️

... and 127 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ajsutton ajsutton marked this pull request as ready for review April 15, 2025 04:46
@ajsutton ajsutton requested review from a team as code owners April 15, 2025 04:46
Copy link
Contributor

@mbaxter mbaxter left a comment

Choose a reason for hiding this comment

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

Thanks - looks good!

Left a few nits + I think we should do more validation in NewFromState.

@ajsutton ajsutton requested a review from mbaxter April 15, 2025 23:30
@ajsutton ajsutton enabled auto-merge April 16, 2025 21:30
@ajsutton ajsutton added this pull request to the merge queue Apr 16, 2025
Merged via the queue into develop with commit 4387873 Apr 16, 2025
49 checks passed
@ajsutton ajsutton deleted the aj/cannon-feature-toggles branch April 16, 2025 21:50
iquidus pushed a commit to Layr-Labs/optimism that referenced this pull request Jul 24, 2025
* cannon: Introduce feature toggles.

* cannon: Support multiple current versions.

* cannon: Update tests

* cannon: Update tests for SysEventFd2 support

* Only fuzz latest version.

* cannon: Improve testing.

* cannon: Remove eventfd2 support that snuck in.

* cannon: Skip test more explicitly

* cannon: Pick random version when fuzzing.

* cannon: Verify that version is supported in NewFromState.

All JSON files are unsupported.

* cannon: Use helper
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