-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
Summary
Eliminate the EVM instance that is currently created inside AnteHandler
during the CanTransfer()
balance check. Instead, read the sender’s balance directly via StateDB.GetBalance()
.
Problem Definition
Each transaction spawns two EVM instances.
- AnteHandler(Pre-validation) - runs
CanTransfer()
- Execution(state-transition) - applies opcodes and commits state
In a block of 100 transactions, this results in 200 EVM instantiations, unnecessarily increasing CPU, memory, and GC overhead. Following why I think spawning an instance in the AnteHandler is needless.
- The AnteHandler only needs a balance read; no state change occurs, so a full EVM is dispensable.
- Reference: Geth’s pre-validation path also does not spin up an EVM instance.
Proposed Feature
Remove the evmKeeper.NewEVM()
call in ante/evm/07_can_transfer.go
.
Work Breakdown
#### Must have
- [ ] discuss proposal (if proposal rejected, close EPIC)
- [ ] create ADR (if ADR rejected, close EPIC)
- [ ] add sub-tasks needed to implement the proposed feature
#### Nice to have
- [ ] add sub-tasks that are nice to have for the proposed feature
yihuang
Metadata
Metadata
Assignees
Labels
No labels