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

Filling fixes #516

Merged
merged 8 commits into from
Oct 23, 2024
Merged

Filling fixes #516

merged 8 commits into from
Oct 23, 2024

Conversation

jsign
Copy link
Collaborator

@jsign jsign commented Oct 22, 2024

This PR makes necessary fixes to witness-charging-order-with-limits so it passes all v0.0.6 fixtures.

jsign added 5 commits October 22, 2024 14:00
Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Ignacio Hagopian <[email protected]>
witnessGas uint64
_, isPrecompile = evm.precompile(target)
isSystemContract = evm.isSystemContract(target)
)

// If value is transferred, it is charged before 1/64th
// is subtracted from the available gas pool.
if transfersValue {
if withTransferCosts && !stack.Back(2).IsZero() {
Copy link
Collaborator Author

@jsign jsign Oct 23, 2024

Choose a reason for hiding this comment

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

I honestly would like to have the transfersValue to make this if more clear, but breaking up the if without the && creates a "branching" complexity for the if-elseif-else.

I feel safer being sure we remove L60 since not doing that adds some extra assumptions on what is on the stack for withTransferCosts=false situations -- so with my proposed way I access Back(2) only in cases that matter. In other cases that Back(2) would lead to the wrong semantics of the variable name.

This might feel pedantic, but I prefer not to have confusions or hacky names that only make sense in some situations.

@jsign jsign marked this pull request as ready for review October 23, 2024 19:50
Copy link
Owner

@gballet gballet left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for tackling this.

@gballet gballet merged commit d2e5de3 into witness-charging-order-with-limits Oct 23, 2024
jsign added a commit that referenced this pull request Oct 23, 2024
* fix makeCallVariantGasEIP4762

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* ci: target v0.0.6

Signed-off-by: Ignacio Hagopian <[email protected]>

* improve fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* add witness gas to "old" gas upon error

Signed-off-by: Guillaume Ballet <[email protected]>

* workflow: remove target branch from list of branches

---------

Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Guillaume Ballet <[email protected]>
Co-authored-by: Guillaume Ballet <[email protected]>
gballet added a commit that referenced this pull request Oct 24, 2024
* state: access witness with partial cost charging

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix most problems

Signed-off-by: Ignacio Hagopian <[email protected]>

* rebase fixes

Signed-off-by: Ignacio Hagopian <[email protected]>

* fixes

Signed-off-by: Ignacio Hagopian <[email protected]>

* fixes

Signed-off-by: Ignacio Hagopian <[email protected]>

* .

Signed-off-by: Ignacio Hagopian <[email protected]>

* remove 4762 gas call wrappers

Signed-off-by: Ignacio Hagopian <[email protected]>

* more progress

Signed-off-by: Ignacio Hagopian <[email protected]>

* call gas

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* simplify warm costs

Signed-off-by: Ignacio Hagopian <[email protected]>

* cleanup

Signed-off-by: Ignacio Hagopian <[email protected]>

* commit statedb

Signed-off-by: Ignacio Hagopian <[email protected]>

* pass upper bound for gas consumption

Signed-off-by: Guillaume Ballet <[email protected]>

* fix missing gas sum

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix: warm storage cost for basic data and code hash

* fix: return wanted in TouchBasicData gas functions

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix: add history contract to TestProcessorVerkle

* ci: new workflows for testing (#504)

* ci: new workflows for testing

Signed-off-by: Ignacio Hagopian <[email protected]>

* nit

Signed-off-by: Ignacio Hagopian <[email protected]>

* ci: fix stable consumption

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* more fixes

Signed-off-by: Ignacio Hagopian <[email protected]>

* more fixes

Signed-off-by: Ignacio Hagopian <[email protected]>

* update tag

Signed-off-by: Ignacio Hagopian <[email protected]>

---------

Signed-off-by: Ignacio Hagopian <[email protected]>

* import fixes from base branch until 51dca93

Signed-off-by: Guillaume Ballet <[email protected]>

* fix: create init order redux (#510)

Signed-off-by: Guillaume Ballet <[email protected]>

* import most changes from jsign-witness-fix

Co-authored-by: Ignacio Hagopian <[email protected]>

Signed-off-by: Guillaume Ballet <[email protected]>

* rebase nits

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix: move 1/64 before gas call

* fix: value transfer gas charge before 1/64th + warm costs for precomp + system contracts

Signed-off-by: Guillaume Ballet <[email protected]>

* Filling fixes (#516)

* fix makeCallVariantGasEIP4762

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* ci: target v0.0.6

Signed-off-by: Ignacio Hagopian <[email protected]>

* improve fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* add witness gas to "old" gas upon error

Signed-off-by: Guillaume Ballet <[email protected]>

* workflow: remove target branch from list of branches

---------

Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Guillaume Ballet <[email protected]>
Co-authored-by: Guillaume Ballet <[email protected]>

* nit

Signed-off-by: Ignacio Hagopian <[email protected]>

* fix compilation error

Signed-off-by: Ignacio Hagopian <[email protected]>

* Fill fixes continued (#519)

* fix selfdestruct

Signed-off-by: Ignacio Hagopian <[email protected]>

* extcodecopy witness fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* blockhash fix

Signed-off-by: Ignacio Hagopian <[email protected]>

* run ci

Signed-off-by: Ignacio Hagopian <[email protected]>

* Apply suggestions from code review

remove diff used for test

* same thing in other file

---------

Signed-off-by: Ignacio Hagopian <[email protected]>
Co-authored-by: Guillaume Ballet <[email protected]>

---------

Signed-off-by: Ignacio Hagopian <[email protected]>
Signed-off-by: Guillaume Ballet <[email protected]>
Co-authored-by: Ignacio Hagopian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants