iron-fish / ironfish

A novel cryptocurrency focused on privacy and accessibility.
https://ironfish.network
Mozilla Public License 2.0
964 stars 579 forks source link

implements BlockchainDBTransaction to wrap EVM state changes #5083

Closed hughy closed 1 week ago

hughy commented 1 week ago

Summary

the ethereumjs packages implement their own systems for committing changes to the underlying database

plumbing our own database transaction objects down through several layers will require significant refactoring to evm caching and database access

BlockchainDBTransaction wraps an IDatabaseTransaction and inserts logic to use the evm stateManager's checkpoint logic for committing and reverting state changes

implements transaction and withTransaction methods on the BlockchainDB and replaces access of the underlying db instance with these transaction methods to ensure that BlockchainDBTransactions are used

moves stateManager directly onto BlockchainDB to support access in transaction context

Testing Plan

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API Reference)? If yes, link a related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes