-
Notifications
You must be signed in to change notification settings - Fork 773
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EVM/Common: SimpleStateManager (#3482)
* Add SimpleStateManager implementation * Common SimpleStateManager fixes, add explicit ethereum-cryptography dependency (already in through Util dependency) * Rebuild package-lock.json * Integrate SimpleStateManager into existing checkpointing tests * Integrate into EVM, remove stateManager dependency * Rebuild packack-lock.json * Move OriginalStorageCache class to Common, deprecate old location * Use full OriginalStorageCache implementation in SimpleStateManager * Add some docs * Rename topA, topC, topS to something more expressive, make protected * Rename add() -> checkpointSync(), make protected * More elegant commit() implementation * Add flexible keccak256 * Minor * Update packages/common/src/state/simple.ts Co-authored-by: Gabriel Rocheleau <contact@rockwaterweb.com> * move simple to stateManager * add simple example * lint * Revert bundler config changes * update docs * address feedback * address feedback --------- Co-authored-by: Scorbajio <indigophi@protonmail.com> Co-authored-by: Gabriel Rocheleau <contact@rockwaterweb.com> Co-authored-by: acolytec3 <17355484+acolytec3@users.noreply.github.com>
- Loading branch information
1 parent
94d02e6
commit ef20930
Showing
15 changed files
with
1,082 additions
and
795 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { SimpleStateManager } from '../src/index.js' | ||
import { Account, Address, randomBytes } from '@ethereumjs/util' | ||
|
||
const main = async () => { | ||
const sm = new SimpleStateManager() | ||
const address = Address.fromPrivateKey(randomBytes(32)) | ||
const account = new Account(0n, 0xfffffn) | ||
await sm.putAccount(address, account) | ||
console.log(await sm.getAccount(address)) | ||
} | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export * from './accessWitness.js' | ||
export * from './cache/index.js' | ||
export * from './rpcStateManager.js' | ||
export * from './simpleStateManager.js' | ||
export * from './statelessVerkleStateManager.js' | ||
export * from './stateManager.js' |
Oops, something went wrong.