ethereum-optimism / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
5.21k stars 2.99k forks source link

cannon: Extract MIPS step helper functions #11017

Closed mbaxter closed 4 days ago

mbaxter commented 4 days ago

Description

Extract common MIPS step logic into a couple of helper functions to prep for code-sharing between multi-threaded Cannon (MTCannon) and Cannon.

Also:

Tests

This is a refactor, existing test coverage should be sufficient.

Additional context

Builds on https://github.com/ethereum-optimism/optimism/pull/10978

Metadata

Part of https://github.com/ethereum-optimism/client-pod/issues/908

codecov[bot] commented 4 days ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 61.29%. Comparing base (7f403ea) to head (bfd9937). Report is 5 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #11017 +/- ## =========================================== - Coverage 61.32% 61.29% -0.03% =========================================== Files 20 20 Lines 1753 1757 +4 Branches 71 71 =========================================== + Hits 1075 1077 +2 - Misses 646 648 +2 Partials 32 32 ``` | [Flag](https://app.codecov.io/gh/ethereum-optimism/optimism/pull/11017/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum-optimism) | Coverage Δ | | |---|---|---| | [cannon-go-tests](https://app.codecov.io/gh/ethereum-optimism/optimism/pull/11017/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum-optimism) | `80.93% <100.00%> (-0.11%)` | :arrow_down: | | [chain-mon-tests](https://app.codecov.io/gh/ethereum-optimism/optimism/pull/11017/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum-optimism) | `27.14% <ø> (ø)` | | | [sdk-tests](https://app.codecov.io/gh/ethereum-optimism/optimism/pull/11017/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum-optimism) | `16.44% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum-optimism#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/ethereum-optimism/optimism/pull/11017?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum-optimism) | Coverage Δ | | |---|---|---| | [cannon/mipsevm/mips.go](https://app.codecov.io/gh/ethereum-optimism/optimism/pull/11017?src=pr&el=tree&filepath=cannon%2Fmipsevm%2Fmips.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum-optimism#diff-Y2Fubm9uL21pcHNldm0vbWlwcy5nbw==) | `69.52% <100.00%> (-13.37%)` | :arrow_down: | | [cannon/mipsevm/mips\_instructions.go](https://app.codecov.io/gh/ethereum-optimism/optimism/pull/11017?src=pr&el=tree&filepath=cannon%2Fmipsevm%2Fmips_instructions.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum-optimism#diff-Y2Fubm9uL21pcHNldm0vbWlwc19pbnN0cnVjdGlvbnMuZ28=) | `97.84% <100.00%> (-0.07%)` | :arrow_down: | | [cannon/mipsevm/mips\_syscalls.go](https://app.codecov.io/gh/ethereum-optimism/optimism/pull/11017?src=pr&el=tree&filepath=cannon%2Fmipsevm%2Fmips_syscalls.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ethereum-optimism#diff-Y2Fubm9uL21pcHNldm0vbWlwc19zeXNjYWxscy5nbw==) | `93.33% <ø> (ø)` | |