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

Witness charging order with limits #502

Merged
merged 38 commits into from
Oct 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
60ed072
state: access witness with partial cost charging
jsign Sep 12, 2024
ab90f4c
fix most problems
jsign Sep 12, 2024
f1c6f05
rebase fixes
jsign Sep 12, 2024
88cd5cf
fixes
jsign Sep 16, 2024
3138345
fixes
jsign Sep 16, 2024
711d8a1
.
jsign Sep 16, 2024
3ec64b5
remove 4762 gas call wrappers
jsign Sep 19, 2024
628842b
more progress
jsign Sep 19, 2024
89e6155
call gas
jsign Sep 19, 2024
33f8fe1
fix
jsign Sep 19, 2024
246105c
fix
jsign Sep 19, 2024
84f6792
fix
jsign Sep 19, 2024
65880c7
fix
jsign Sep 19, 2024
95a5d65
fix
jsign Sep 19, 2024
14b5b69
fix
jsign Sep 19, 2024
4dc1913
fix
jsign Sep 19, 2024
82f36b3
fix
jsign Sep 19, 2024
89662eb
fix
jsign Sep 20, 2024
e1a70f0
simplify warm costs
jsign Sep 23, 2024
313ef15
cleanup
jsign Sep 25, 2024
c99a94f
commit statedb
jsign Sep 27, 2024
36d4c27
pass upper bound for gas consumption
gballet Sep 24, 2024
cb26a96
fix missing gas sum
jsign Sep 25, 2024
1ee921b
fix: warm storage cost for basic data and code hash
gballet Sep 25, 2024
e4c5d26
fix: return wanted in TouchBasicData gas functions
gballet Sep 25, 2024
e6ce883
fix
jsign Sep 25, 2024
9886ea9
fix: add history contract to TestProcessorVerkle
gballet Sep 27, 2024
7ce760d
ci: new workflows for testing (#504)
jsign Oct 8, 2024
45e2f6c
import fixes from base branch until 51dca93bb04a4f93a2be9422a56ee8ea9…
gballet Oct 11, 2024
c0ba8e5
fix: create init order redux (#510)
gballet Oct 15, 2024
21c73d1
import most changes from jsign-witness-fix
gballet Oct 22, 2024
2ebc8e8
rebase nits
jsign Oct 22, 2024
da72c04
fix: move 1/64 before gas call
gballet Oct 22, 2024
f3abb68
fix: value transfer gas charge before 1/64th + warm costs for precomp…
gballet Oct 22, 2024
a9b0e68
Filling fixes (#516)
jsign Oct 23, 2024
87408a7
nit
jsign Oct 23, 2024
b5f8705
fix compilation error
jsign Oct 23, 2024
99b78be
Fill fixes continued (#519)
jsign Oct 24, 2024
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
Prev Previous commit
Next Next commit
fix: return wanted in TouchBasicData gas functions
  • Loading branch information
gballet authored and jsign committed Oct 23, 2024
commit e4c5d263c3e7453d7a982dc995ae29700fe2e988
12 changes: 6 additions & 6 deletions core/state/access_witness.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,23 +284,23 @@ func (aw *AccessWitness) TouchCodeChunksRangeAndChargeGas(contractAddr []byte, s
}

func (aw *AccessWitness) TouchBasicData(addr []byte, isWrite bool, availableGas uint64, warmCostCharging bool) uint64 {
chargedGas, wanted := aw.touchAddressAndChargeGas(addr, zeroTreeIndex, utils.BasicDataLeafKey, isWrite, availableGas)
_, wanted := aw.touchAddressAndChargeGas(addr, zeroTreeIndex, utils.BasicDataLeafKey, isWrite, availableGas)
if wanted == 0 && warmCostCharging {
if availableGas < params.WarmStorageReadCostEIP2929 {
return availableGas
}
chargedGas = params.WarmStorageReadCostEIP2929
wanted = params.WarmStorageReadCostEIP2929
}
return chargedGas
return wanted
}

func (aw *AccessWitness) TouchCodeHash(addr []byte, isWrite bool, availableGas uint64) uint64 {
chargedGas, wanted := aw.touchAddressAndChargeGas(addr, zeroTreeIndex, utils.CodeHashLeafKey, isWrite, availableGas)
_, wanted := aw.touchAddressAndChargeGas(addr, zeroTreeIndex, utils.CodeHashLeafKey, isWrite, availableGas)
if wanted == 0 {
if availableGas < params.WarmStorageReadCostEIP2929 {
return availableGas
}
chargedGas = params.WarmStorageReadCostEIP2929
wanted = params.WarmStorageReadCostEIP2929
}
return chargedGas
return wanted
}