chore: add docs for removing from state in system calls (#13447)

This commit is contained in:
Dan Cline
2024-12-19 12:39:11 +02:00
committed by GitHub
parent ef033abaf9
commit 7250ca5d77
4 changed files with 20 additions and 2 deletions

View File

@ -65,6 +65,11 @@ where
}
};
// NOTE: Revm currently marks these accounts as "touched" when we do the above transact calls,
// and includes them in the result.
//
// There should be no state changes to these addresses anyways as a result of this system call,
// so we can just remove them from the state returned.
res.state.remove(&alloy_eips::eip4788::SYSTEM_ADDRESS);
res.state.remove(&evm.block().coinbase);

View File

@ -75,6 +75,11 @@ where
}
};
// NOTE: Revm currently marks these accounts as "touched" when we do the above transact calls,
// and includes them in the result.
//
// There should be no state changes to these addresses anyways as a result of this system call,
// so we can just remove them from the state returned.
res.state.remove(&alloy_eips::eip4788::SYSTEM_ADDRESS);
res.state.remove(&evm.block().coinbase);

View File

@ -51,7 +51,11 @@ where
}
};
// cleanup the state
// NOTE: Revm currently marks these accounts as "touched" when we do the above transact calls,
// and includes them in the result.
//
// There should be no state changes to these addresses anyways as a result of this system call,
// so we can just remove them from the state returned.
res.state.remove(&alloy_eips::eip7002::SYSTEM_ADDRESS);
res.state.remove(&evm.block().coinbase);

View File

@ -53,7 +53,11 @@ where
}
};
// cleanup the state
// NOTE: Revm currently marks these accounts as "touched" when we do the above transact calls,
// and includes them in the result.
//
// There should be no state changes to these addresses anyways as a result of this system call,
// so we can just remove them from the state returned.
res.state.remove(&alloy_eips::eip7002::SYSTEM_ADDRESS);
res.state.remove(&evm.block().coinbase);