telosnetwork / leap

C++ implementation of the Antelope protocol
Other
0 stars 0 forks source link

Subst not applying after changeing subst conf & restart #26

Open guilledk opened 5 months ago

guilledk commented 5 months ago

Found several times by tom & the gang after trying to test new gas estimation changes on telos.evm.

Procedure to trigger it: have a testnet node running substitution with manifest, stop node, switch config to use local subst wasm, restart, old subst will still be applied.

Two theories atm:

1 - related to gas estimation txs beign always reverted, if im correct with current subst logic this txs should cause wasm to be subst while they run but not keep the subst afterwards due to native chainbase undo(), for some reason its not beign applied while estimation runs, must investigate

2 - (less likely) posible issue with on-disk database after restart, would need to add some sort of contract db state reading function

guilledk commented 5 months ago

Third theory: subst plugin metadata/state tracking logic will most likely break if its modified on a transaction that reverts, cause state tracking is done in plugin class instance and code subst is done on the actual on chain db that will get undo() by the end of the tx, this causes metadata and actual subst'd bytecode data to get out of sync.

Solution to this should be doing all our tracking on the on-chain db