-
Notifications
You must be signed in to change notification settings - Fork 43
kaiax/gasless: Fix restore env upon revert #305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kaiax/gasless: Fix restore env upon revert #305
Conversation
This fix does not test revert because it removes transactions from the list before creating a block. |
@Mdaiki0730 It was because the test fails due to invalid merkle root:
I assumed But I understand your point. What do you think should be the new logic of |
@ian0371 Do you know what causes |
@Mdaiki0730 Oh I see. I reverted for now. 5ed118c |
Please consider updating
|
This reverts commit 2e58d70.
5ed118c
to
3d3eaff
Compare
Proposed changes
env.state
with snapshot (work/worker.go
). It fixes bad block issue when a tx in bundle reverts (Error: invalid gas used (remote: 461415 local: 463655)
), which is caused by shallow-copying ofstatedb.stateObjects
.statedb
object fromcommitBundleTransaction()
(i.e.,env.state = lastSnapshot
), oldstatedb
must be reused becausebc.State()
callers will use it. Thus,func (s *StateDB) Set(src *StateDB)
is introduced.copyStateDB()
.GenABlockWithTransactionsWithBundle
to filter failing transactionstxHashesExpectedFail
argument fromUpdate
andGenABlockWithTransactions
, so now it's the same as v1.0.3kaiax/gasless/impl/getter.go
)Types of changes
Checklist
I have read the CLA Document and I hereby sign the CLA
in first time contribute$ make test
)