Skip to content
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

fix: add proof of absence for chunks when contract creation reverts #331

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,12 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
}
}

if err == nil && evm.chainRules.IsPrague {
if !contract.UseGas(evm.Accesses.TouchAndChargeContractCreateCompleted(address.Bytes()[:])) {
evm.StateDB.RevertToSnapshot(snapshot)
err = ErrOutOfGas
if evm.chainRules.IsPrague {
if err == nil || err == ErrExecutionReverted {
if !contract.UseGas(evm.Accesses.TouchAndChargeContractCreateCompleted(address.Bytes()[:])) {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually in the context of a reverted execution, the values should be nil and not the destination values. Let's first confirm that this is indeed a bug that needs fixing, I'm not so sure anymore.

evm.StateDB.RevertToSnapshot(snapshot)
err = ErrOutOfGas
}
}
}

Expand Down
Loading