Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Adjust storage update evm-style #7812

Merged
merged 1 commit into from
Feb 6, 2018
Merged

Adjust storage update evm-style #7812

merged 1 commit into from
Feb 6, 2018

Conversation

NikVolf
Copy link
Contributor

@NikVolf NikVolf commented Feb 5, 2018

This will charge for setting already initialized storage entries less, also will track refunded (storage set back to zero from non-zero)

@NikVolf NikVolf added A0-pleasereview 🤓 Pull request needs code review. B0-patch M4-core ⛓ Core client code / Rust. labels Feb 5, 2018
@5chdn 5chdn added this to the 1.10 milestone Feb 6, 2018
if former_val == H256::zero() && val != H256::zero() {
self.adjusted_charge(|schedule| schedule.sstore_set_gas as u64)?;
} else {
self.adjusted_charge(|schedule| schedule.sstore_reset_gas as u64)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

So the decision table for this check looks like this:

case rate
0 → 0 reset
0 → ≠0 set
≠0 → 0 reset
≠0 → ≠0 reset

Is that intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

!= 0 -> 0

also leads to storage_clears ++ which is later handled by inter-vm rules

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see, thanks.

@debris debris added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Feb 6, 2018
@debris debris merged commit 0a7cebe into master Feb 6, 2018
@debris debris deleted the wasm-gas-update branch February 6, 2018 10:57
tomusdrw pushed a commit that referenced this pull request Feb 14, 2018
5chdn pushed a commit that referenced this pull request Feb 14, 2018
* update back-references more aggressively after answering from cache (#7578)

* Add new EF ropstens nodes. (#7824)

* Add new EF ropstens nodes.

* Fix tests

* Add a timeout for light client sync requests (#7848)

* Add a timeout for light client sync requests

* Adjusting timeout to number of headers

* Flush keyfiles. Resolves #7632 (#7868)

* Fix wallet import (#7873)

* rpc: generate new account id for imported wallets

* ethstore: handle duplicate wallet filenames

* ethstore: simplify deduplication of wallet file names

* ethstore: do not dedup wallet filenames on update

* ethstore: fix minor grumbles

* [WASM] mem_cmp added to the Wasm runtime (#7539)

* mem_cmp added to the Wasm runtime

* schedule.wasm.mem_copy to schedule.wasm.mem_cmp for mem_cmp

* [Wasm] memcmp fix and test added (#7590)

* [Wasm] memcmp fix and test added

* [Wasm] use reqrep_test! macro for memcmp test

* wasmi interpreter (#7796)

* adjust storage update evm-style (#7812)

* disable internal memory (#7842)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants