-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Design Documents Refactor EVM into a Standalone Library
Status: Proposed
Pull out the EVM functionality from the core subproject/module into a separate evm subproject module, suitable for use as a library component. Limited to no classes unrelated to EVM functionality will be required for the dependency (example: no QBFT, no ETCHash, no transaction type code, etc).
Besu is currently monolithic in its deployment. While there is some component and package separation, those are mostly accidental and reflect boundaries between developer groups. There are a number of components that may be severable with effort (EVM, consensus, p2p, rpc, network definitions, etc). The EVM is fairly self contained and would be a good starting point to start this process.
- Deep code changes may be required.
- No measurable performance regressions for mainnet and existing public networks.
- Usable by other projects:
- Usable by Web3j in their local EVM execution tasks.
- Includable in other DLTs (or Layer 2s) without requiring full mainnet semantics.
- Includable in Android applications without large library dependencies.
- Ultimately move to a top-level repo as a Besu subproject.
- Within Besu, either included via submodule reference or via synchronized releases.
- To the extent possible, testable with existing Ethereum reference tests (via t8n tool interfaces).
- Pluggable EVM/Contract layer.
- May be a good idea, but not now.
Anticipated changes:
- Create appropriate Interface classes for use by Besu to access the EVM component.
- Pretty much anything
Mainnet*is a candidate here.
- Pretty much anything
- Move code to new directory/repository.
- Rework build scripts to support new locations.
Targets of opportunity:
- Re-implement EVM Tool to just the EVM library.
- Support t8n tool formats.
- Quarkus/GraalVM AOT build (suitable for fuzz testing).
- Publish library to maven central.
- Use the
o.h.b.plugin.dataclasses instead of theo.h.b.coreclasses.- The
o.h.b.coreclasses that need it will all gain afromPluginmethod if they don't have it already.
- The
- Change
BlockHashLookupparameters and such toFunction<Long, Hash>. - Remove blockchain reference (only needed for
BlockHashLookup). - Add
setContextVar/getContextVarmethods and move Privacy things there.isPersistingPrivateStategetPrivateStateMetadataUpdatertransaction-
transactionHash(pmtHash)
- Move to Tuweni Wei.
- Move
Gasfrom Core to EVM. - Factor out transaction wrapper gas calculations into a new
BlockchainGasCalculator.- Extracting access lists and intrinsic costs of TX
- Code deposit cost
- Max pmt cost
- Create in EVM world state updater interface.
- Remove uses of account and delegate to the storage interface.
- Add method to test if an account
isEmpty. - For an address, get current storage value.
- For an address, get original storage value.
- Add method to test if an account
- Create EVM-focused block header interface (to support operations), possibly add to
o.h.b.plugin.data.- basefee
- blockhash (?)
- difficulty
- gaslimit
- block number
- block timestamp
- Move account "warm-up" out of the EVM into
MainnetTransactionProcessor.- Not the tracking of warm addresses/slots, but the actual reading from the DB.
- Remove contract versioning.
besu-eth/wiki and edits made here are overwritten on the next publish. To change a page, open a pull request against the source repo instead. See Home for how.
Contributing
Development & Testing
Developing & Conventions
Project Process
Governance
Incident Reports
- 2024-01-06 Mainnet Halting Event
- 2022-11-11 Fork on Sepolia
- 2022-05-30 Phishing PRs
- 2021-08-04 Value Transfer Public Transactions Rejected
- 2021-04-23 ATs Failures
Performance & Stability
- Improvements Since the Merge
- Memory Usage Investigations (23.7.3-RC)
- Reduce Memory Usage
- Testing Taskforce Brainstorming
- Q4 2022 Stability and Improvements
- Permissioned Chain Testing
Design Documents
- Design Documents
- Modular Besu
- Refactor EVM into a Standalone Library
- Bonsai Tries Design Overview
- Bonsai Archive Feature
- Bonsai Archive State Proofs
- Switchable Consensus Parameters
- SECP256R1 Support
- RPC Endpoint Service
- Feature Proposal Template
- Feature Flags
- CI/CD Tooling and Process
Programs & Mentorship