Martin HS
0d4c38865e
core/state: remove account reset operation v2 ( #29520 )
...
* core/state, tests: remove account reset operation
* core/state, core/vm: implement createcontract journal event
* core/state: make createcontract not emit dirtied account, unskip tests
* core/state: add createcontract to journal fuzzing
* core/state: fix journal
* core/state: address comments
* core/state: remove useless code
---------
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
7 months ago
Martin HS
a5a4fa7032
all: use uint256 in state ( #28598 )
...
This change makes use of uin256 to represent balance in state. It touches primarily upon statedb, stateobject and state processing, trying to avoid changes in transaction pools, core types, rpc and tracers.
10 months ago
rjl493456442
817553cc28
core, trie: track state change set with account address ( #27815 )
1 year ago
jwasinger
d233b6b23a
core: replace instances of 'suicide' with 'selfdestruct' to improve code consistency. ( #27716 )
...
---------
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
1 year ago
rjl493456442
4b06e4f25e
core/state: value diff tracking in StateDB ( #27349 )
...
This change makes the StateDB track the state key value diff of a block transition.
We already tracked current account and storage values for the purpose of updating
the state snapshot. With this PR, we now also track the original (pre-transition) values
of accounts and storage slots.
1 year ago
rjl493456442
380fb4e249
core/state: clear out cached state data when reset occurs ( #27376 )
...
* core/state: remove cached snap data if reset occurs
* core/state: address comment from peter
* core/state: skip revert in case data is nil
1 year ago
rjl493456442
15bd21f3c8
core/state: mark account as dirty when resetObject occurs ( #27339 )
...
This changes the journal logic to mark the state object dirty immediately when it
is reset.
We're mostly adding this change to appease the fuzzer. Marking it dirty immediately
makes no difference in practice because accounts will always be modified by EVM
right after creation.
2 years ago
rjl493456442
c87f321b8f
core/state: maintain destruction flag by default ( #26371 )
...
This changes moves the tracking of "deleted in this block" out from snap-only domain, so that it happens regardless of whether the execution is snapshot-backed or trie-backed.
2 years ago
Mark Tyneway
b4ea2bf7dd
all: implement EIP-1153 transient storage ( #26003 )
...
Implements TSTORE and TLOAD as specified by the following EIP:
https://eips.ethereum.org/EIPS/eip-1153
https://ethereum-magicians.org/t/eip-1153-transient-storage-opcodes/553
Co-authored-by: Sara Reynolds <snreynolds2506@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2 years ago
hsyodyssey
84bccd0900
core/state: fix typos in comments ( #23702 )
3 years ago
Martin Holst Swende
6487c002f6
all: implement EIP-2929 (gas cost increases for state access opcodes) + yolo-v2 ( #21509 )
...
* core/vm, core/state: implement EIP-2929 + YOLOv2
* core/state, core/vm: fix some review concerns
* core/state, core/vm: address review concerns
* core/vm: address review concerns
* core/vm: better documentation
* core/vm: unify sload cost as fully dynamic
* core/vm: fix typo
* core/vm/runtime: fix compilation flaw
* core/vm/runtime: fix renaming-err leftovers
* core/vm: renaming
* params/config: use correct yolov2 chainid for config
* core, params: use a proper new genesis for yolov2
* core/state/tests: golinter nitpicks
4 years ago
Martin Holst Swende
074efe6c8d
core: fix two snapshot iterator flaws, decollide snap storage prefix
...
* core/state/snapshot/iterator: fix two disk iterator flaws
* core/rawdb: change SnapshotStoragePrefix to avoid prefix collision with preimagePrefix
5 years ago
Felix Lange
dd21f079e8
core/state: fix staticcheck warnings ( #20357 )
...
Also remove dependency on gopkg.in/check.v1 in tests.
5 years ago
Péter Szilágyi
d985b9052a
core/state: avoid linear overhead on journal dirty listing
7 years ago
Martin Holst Swende
958ed4f3d9
core/state: rework dirty handling to avoid quadratic overhead
7 years ago
Péter Szilágyi
6f69cdd109
all: switch gas limits from big.Int to uint64
7 years ago
Felix Lange
a0d783094e
core/state: revert log index when removing logs
7 years ago
Péter Szilágyi
ff9a868232
core/state: revert metro suicide map addition ( #15024 )
7 years ago
Jeffrey Wilcke
e7119ce12d
core/state: fixed (self)destructed objects
...
Add the object to the list of destructed objects during a selfdestruct /
suicide operation and also remove it from the list once the journal
reverts.
8 years ago
gary rong
49437a02c9
core/state: make TestSnapshotRandom work again ( #3816 )
...
In `touch` operation, only `touched` filed has been changed. Therefore
in the related undo function, only `touched` field should be reverted.
In addition, whether remove this obj from dirty map should depend on
prevDirty flag.
8 years ago
Jeffrey Wilcke
024d41d0c2
core, core/state, core/vm: remove exported account getters ( #3618 )
...
Removed exported statedb object accessors, reducing the chance for nasty
bugs to creep in. It's also ugly and unnecessary to have these methods.
8 years ago
Nick Johnson
17d92233d9
cmd/geth, core: add support for recording SHA3 preimages ( #3543 )
8 years ago
Jeffrey Wilcke
12d654a6fc
core, core/state: fixed consensus issue added touch revert
...
Implemented proper touch revert journal entries and copied a Parity
consensus bug in order to remain in sync with the current longest chain.
8 years ago
Felix Lange
90fce8bfa6
core/state: rename Delete/IsDeleted to Suicide/HasSuicided
...
The delete/remove naming has caused endless confusion in the past.
8 years ago
Felix Lange
1f1ea18b54
core/state: implement reverts by journaling all changes
...
This commit replaces the deep-copy based state revert mechanism with a
linear complexity journal. This commit also hides several internal
StateDB methods to limit the number of ways in which calling code can
use the journal incorrectly.
As usual consultation and bug fixes to the initial implementation were
provided by @karalabe , @obscuren and @Arachnid . Thank you!
8 years ago