remove shared memory from precompiles and accept #1383
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this should be merged
Currently shared memory writes version DB to the shared database (avaDB). This conflicts and corrupts the standaloneDB and leads to a duality in data sources: acceptedBlockDB and metaDB were being written to the shared db (avaDB) and chaindb was being written to the standalone DB. This PR removes the unused shared memory components from subnet-evm.
How this works
This pull request includes significant refactoring and cleanup of the
plugin/evm
package, specifically focusing on the removal of shared memory operations and simplifying database interactions. The most important changes include the removal of thesharedMemoryWriter
, modifications to theAccept
method, and updates to the test cases to reflect these changes.plugin/evm/block.go
: Removed the use ofsharedMemoryWriter
and related logic from theAccept
method andhandlePrecompileAccept
function. [1] [2] [3]plugin/evm/shared_memory_writer.go
: Deleted the entireshared_memory_writer.go
file, which included thesharedMemoryWriter
implementation.plugin/evm/vm.go
: Modified theinitializeDBs
method to useavaDB
directly instead of creating a versioned database.plugin/evm/vm_test.go
: Updated test setup to usebaseDB
directly and added a new testTestStandaloneDB
to ensure the standalone database is used correctly. [1] [2]How this was tested
Added regression UT & locally tested
Need to be documented?
No
Need to update RELEASES.md?
No