Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(evm): revert all revm changes #5610

Merged
merged 2 commits into from
Aug 11, 2023
Merged

fix(evm): revert all revm changes #5610

merged 2 commits into from
Aug 11, 2023

Conversation

Evalir
Copy link
Member

@Evalir Evalir commented Aug 11, 2023

Motivation

For some reason the revm upgrade broke a lot of stuff that shouldn't have been broken considering the migration was mostly transparent, and we've yet to triage the entirety of the issue.

Solution

Revert back to release/25 as a stable revm version. The current branch with latest revm changes is now latest-revm.

@Evalir Evalir requested a review from mattsse August 11, 2023 18:03
@mattsse
Copy link
Member

mattsse commented Aug 11, 2023

sharing my preliminary findings,

for some reason the upgrade broke some requires

HB:INVALID_WEIGHTS] invariant_fixedTermLoanManager_A() (runs: 1, calls: 23, reverts: 1)

which are caused by warps

  [0] DistributionHandler::distributorEntryPoint(1517936943072132424547585717294012335460981354448299090815164687 [1.517e63]) 
    ├─ [43820] 0x89CA9F4f77B267778EB2eA0Ba1bEAdEe8523af36::a6c4cff2(000000000003b09d4e7ad46bf4ed664cf7e3df863b40fc4a7f944ec95493210f) 
    │   ├─ [2519] DefaultsInvariants::currentTimestamp() [staticcall]
    │   │   └─ ← 1686326237 [1.686e9]
    │   ├─ [16831] VM::warp(1686326237 [1.686e9]) 
    │   │   └─ ← "HB:INVALID_WEIGHTS"
    │   ├─ [0] console::log(134087050498717332775286796463387467468078506391250064 [1.34e53]) [staticcall]
    │   │   └─ ← ()
    │   └─ ← 0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001248423a494e56414c49445f574549474854530000000000000000000000000000
    └─ ← ()

not sure why

@@ -270,7 +265,7 @@ impl MemDb {
accounts.insert(add, acc.info);

let acc_storage = storage.entry(add).or_default();
if acc.status.contains(AccountStatus::Created) {
Copy link
Member Author

Choose a reason for hiding this comment

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

While this should be OK, it seems that the commit function might need some tweaking, as it seems it wasn't recording the accounts as it should. We tried matching revm's commit fn but the issues still persisted.

@@ -260,7 +260,7 @@ pub fn collect_created_contracts(

for (address, account) in state_changeset {
if !setup_contracts.contains_key(&b160_to_h160(*address)) {
if let (true, Some(code)) = (&account.is_touched(), &account.info.code) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only part that really touches the fuzz strategies. It leads me to believe—maybe account recording is not being done correctly in some edge cases?

Copy link
Contributor

Choose a reason for hiding this comment

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

This "should" be fine, is_touched have the same functionality, and if it was wrong, bug would probably be a lot more serious and would pop on mainnet sync.

@Evalir Evalir merged commit a0a31c3 into master Aug 11, 2023
21 checks passed
@Evalir Evalir deleted the evalir/revert-revm branch August 11, 2023 18:37
Evalir added a commit that referenced this pull request Aug 19, 2023
Evalir added a commit that referenced this pull request Aug 21, 2023
* Revert "fix(`evm`): revert all revm changes (#5610)"

This reverts commit a0a31c3.

* upgrade revm

* fmt
mikelodder7 pushed a commit to LIT-Protocol/foundry that referenced this pull request Sep 12, 2023
* Revert "fix(`evm`): revert all revm changes (foundry-rs#5610)"

This reverts commit a0a31c3.

* upgrade revm

* fmt
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.

3 participants