Closed rabbitprincess closed 9 months ago
OK, a sync test can be run to check its backwards compatibility
sync start [mainnet] Dec 7 05:02:14.485 INF ../go/aergo/cmd/aergosvr/aergosvr.go:98 > AERGO SVR STARTED branch=feature/refactor-state module=asvr revision=f7b6e39f
sync success
@kroggen can you approve this pr?
I will check for conflicts, tomorrow
@gokch
Why AccountState
is on state
and ContractState
is on statedb
?
I am also curious why many functions were moved from state
to statedb
The separation of vmAutoload
, vmLoadCode
and vmLoadCall
was completely unnecessary.
They are related and were together at the end of the file.
I only now saw this
@gokch
Why
AccountState
is onstate
andContractState
is onstatedb
?I am also curious why many functions were moved from
state
tostatedb
contractState is only modified by lua contract, but accountState is modified by lua contract and external chain. I tried to collect only changed state by lua into statedb. ( but, statedb is not clear package name. )
and, Although it is not confirmed, this also considering evm support. evm and lua have their own state db, but they share same accountState.
The separation of
vmAutoload
,vmLoadCode
andvmLoadCall
was completely unnecessary. They are related and were together at the end of the file. I only now saw this
yes, and it is also good to separate vmContext and executor. ( make new file vm_executor.go ) Current pr`s purpose is for refactor state, so it seems better to change it in another pr.
What is changed?
add id field in ContractState ( to identify AccountState in vm ) move ContractState to statedb ( it related with evm_state_wip ) change balance modify logic in vm.go to use AccountState (luaSendAmount, luaCallContract, luaDeployContract) replace add/sub balance logic to state.SendBalance() fix some tests in vm and governance
Is there risk of fork?
yes. it need to sync test.