Skip to content

chore: use cheatcodes instead of calling directly#12047

Merged
LHerskind merged 5 commits intomasterfrom
lh/12001-delete-cheatcodes
Feb 25, 2025
Merged

chore: use cheatcodes instead of calling directly#12047
LHerskind merged 5 commits intomasterfrom
lh/12001-delete-cheatcodes

Conversation

@LHerskind
Copy link
Contributor

@LHerskind LHerskind commented Feb 17, 2025

Fixes #12001.

Biggest changes:

  • Removes the assumeProvenThrough, no more calls to the contract to update that one
  • Use anvil cheatcodes to directly overwrite the storage and update the proven block number
  • Adding task on the anvil test watcher, to mark blocks as proven
    • Can be toggled by updating isMarkingAsProven
    • For example see the fee tests or the e2e_block building test that is trying to re-org

The watcher chances could feel a little clunky. But as we are in most cases not testing the proving, this felt like the best way to make a sane default ("automining") and then require an extra step for the case of using a prover node or no proving at all.

This was referenced Feb 17, 2025
Copy link
Contributor Author

LHerskind commented Feb 17, 2025

@LHerskind LHerskind marked this pull request as ready for review February 17, 2025 15:59
@LHerskind LHerskind force-pushed the lh/12001-delete-cheatcodes branch from 87b9910 to 06574cd Compare February 17, 2025 16:13
@LHerskind LHerskind force-pushed the lh/12001-delete-cheatcodes branch from 06574cd to 910ca9e Compare February 18, 2025 00:34
Base automatically changed from lh/11949 to master February 18, 2025 09:04
@LHerskind
Copy link
Contributor Author

Running into some issues with a couple of the fee tests because the proving is now not happening, and marking as proven will not actually execute the logic and pay out. Fee tests need to be updated such that they are running with a simulated prover.

@LHerskind LHerskind force-pushed the lh/12001-delete-cheatcodes branch from 910ca9e to b51628e Compare February 18, 2025 17:35
@LHerskind LHerskind mentioned this pull request Feb 18, 2025
@LHerskind
Copy link
Contributor Author

Running into some issues with a couple of the fee tests because the proving is now not happening, and marking as proven will not actually execute the logic and pay out. Fee tests need to be updated such that they are running with a simulated prover.

Also see #12089

@LHerskind LHerskind force-pushed the lh/12001-delete-cheatcodes branch from b51628e to c720843 Compare February 24, 2025 17:20
@LHerskind LHerskind force-pushed the lh/12001-delete-cheatcodes branch from c720843 to fa3f88d Compare February 25, 2025 08:25
Comment on lines +145 to +147
this.logger.info(
`Proven tip moved: ${tipsBefore.proven} -> ${tipsAfter.proven}. Pending tip moved: ${tipsBefore.pending} -> ${tipsAfter.pending}`,
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Stupid question: why would the pending tip move, other than another block landing while this was happening?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, this was probably me brainfarting, I just wanted to see the pending chain as well, to make it explicit 😅. Should just have a "pending tip". as it as you say should not be moving.

Comment on lines +125 to +126
// @note @LHerskind this is heavily dependent on the storage layout and size of values
// The rollupStore is a struct and if the size of elements or the struct changes, this can break
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd add a small test then, specifically for this bit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

One of the things further in the stack is breaking this because the slot change, but into more predictable with the diamond like storage setup, so were planning to deal with it in there #12063

@LHerskind LHerskind merged commit db4853f into master Feb 25, 2025
11 checks passed
@LHerskind LHerskind deleted the lh/12001-delete-cheatcodes branch February 25, 2025 13:17
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.

refactor: kill assume proven contract cheatcodes

3 participants