Nazarii Denha
7c3657b61b
feat: make BLOCKHASH return only last blockhash ( #196 )
...
* make BLOCKHASH return only last blockhash
* fix
* small fix
2023-02-10 13:06:42 +08:00
Péter Garamvölgyi
81e7775aa8
feat: dual code hash ( #188 )
...
* add KeccakCodeHash and CodeSize to StateAccount
* update StateAccount marshalling logic
* change emptyCodeHash to poseidon(nil)
* purge StateAccount.hash
* fix/disable failing tests
* change keccak and poseidon hash order in StateAccount
* fix lint
* update l2trace account wrapper
* update eth_getProof response type
* fix eth_getProof response type
* goimports
* update the codehash computation
* update the codehash test cases
* go mod tidy
* fix tests
* use keccak instead of poseidon
* update trace codehash field name
* upgrade zktrie to 4.2
* trigger ci
* update state account marshalling according to spec
* improve generatorStats estimation
* add comment
* upgrade zktrie to 4.3
* go mod tidy
* misc fixes
* fix TestDump
* fix snap sync tests
* handle err in the codehash
* fix tests in snapshot/generate_test.go
* remove prevhash from state journal
* add state_account_marshalling_test.go
* goimports
* add more tests
---------
Co-authored-by: Ho Vei <noelwei@gmail.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
2023-02-08 16:12:41 -08:00
Péter Garamvölgyi
2891916a0f
feat: Add Scroll fee vault address as fee recipient ( #187 )
...
* feat: add Scroll fee vault address as fee recipient
* log fee vault address if configured
* lint
* disable fee vault in test presets
* add simple test
2023-01-12 10:11:33 +01:00
Péter Garamvölgyi
61e2bdd05f
feat: return 0 for op DIFFICULTY ( #167 )
2022-10-27 17:31:45 +08:00
Ho
4ee7885525
Fix witness generator for failed call/create op and tx ( #146 )
...
* update test examples
* update tests
* solidify account deleting
* update zkwriter for reverting
* solid handling for call, and update test examples
* fix status capture for CREATE issue, update test examples
* add fail case for deploy
* update test example (call non-exist address)
* move test and stuffs to internal path, make required exports
* fix issue in selfdestruct
* update destruct test
* lint
* rename traces
2022-10-10 17:13:24 +08:00
maskpp
3a7da33cd5
fix: fix not using point for sync.Pool recycling ( #158 )
...
fix bug
2022-09-20 15:05:44 +08:00
Ho
edbb595e66
Trace the account accessed by EXTCODE op ( #157 )
...
add account touch by 'EXTCODE' for storeTrace
2022-09-17 22:44:29 -07:00
maskpp
9182a74334
fix logs error tracing ( #154 )
...
* fix err handle
* fix err handle
* fix err handle
2022-09-13 11:15:31 +08:00
Péter Garamvölgyi
304af60f50
feat: change bytecode hash function from Keccak to Poseidon ( #149 )
...
* feat: change bytecode hash function from Keccak to Poseidon
* fix TestStateProcessorErrors
* rename files
* copy iden3's poseidon package to local
* update poseidon hash
* apply new hash in codehash
* extend hash method, use actual code size as cap
* prune keccak(nil) for empty code
* update empty code hash references to Poseidon
* add TestPoseidonCodeHash
* use keccak for empty code hash
* go mod tidy
* goimports
* use Poseidon code hash in state and sync tests
* run goimports
* run goimports
* remove unnecessary reallocation from CodeHash
* goimports
* move codehash API to separate module
* add missing package
* fix review comments
* improve comments
Co-authored-by: Ho Vei <noelwei@gmail.com>
2022-09-08 06:16:17 +08:00
Péter Garamvölgyi
00ed553a57
feat: disable SELFDESTRUCT opcode in l2geth ( #147 )
...
* feat: disable SELFDESTRUCT opcode in l2geth
* remove deadcode
2022-08-22 14:17:57 -07:00
HAOYUatHZ
eb11a84c56
fix(trace): add more opcode handlings ( #128 )
2022-07-24 21:39:33 +08:00
Ho
3682e05f3f
zktrie part3: include zktrie witness in block trace; add demo for generating witness data for mpt circuit ( #123 )
...
* demo for witness generator
* add simple binary for witness generating
* revert the witgen utility
* purge some code
* induce mptwitness argument
* handle case for failed tx, and special block in POA
* mptwitness: refactor for enabling output ops with different order
* induce witness gen with rwtable order
* self-documenting options for mptwitness
* fix trace flag according to review
* fix issue in handling failed tx
* refactor
* update according to reviews
Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
2022-07-16 07:00:07 +08:00
Ho
c516a9e477
zktrie part2: add zktrie; allow switch trie type by config; ( #113 )
...
* induce zktrie
* refactoring zktrie
* fix crash issue in logger
* renaming JSON field
* unify hash scheme
* goimport and mod lint
* backward compatible with go 1.17
* lints
* add option on genesis file
* corrections according to the reviews
* trivial fixes: ValueKey entry, key in prove nodes
* fixing for the proof fix ...
* avoiding panic before loading stateDb in genesis setup
* revert ExtraData.StateList json annotation for compatibility
* fix goimports lint
* fix goimports lint
* better encoding for leaf node
* fix proof's printing issue, add handling on coinbase
* update genesis, and rule out snapshot in zktrie mode
* update readme and lint
* fix an issue
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
2022-06-27 11:17:02 +08:00
HAOYUatHZ
21b65f4944
core/vm: Make INVALID a defined opcode ( #118 )
...
core/vm: Make INVALID a defined opcode (#24017 )
* core/vm: Define 0xfe opcode as INVALID
* core/vm: Remove opInvalid as opUndefined handles it
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Co-authored-by: Andrei Maiboroda <andrei@ethereum.org>
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
2022-06-22 17:18:47 +08:00
maskpp
e15d0d35cb
fix: fix codeList type ( #117 )
2022-06-21 18:25:07 +08:00
Zhang Zhuo
d3bc8322dc
zktrie part1: change storage proof from per step to per block ( #102 )
...
* change storage proof from step-wise to block-wise. Step-wise proof will be reconstructed in prover side
* minor
* minor
* Update worker.go
* purge hexInt
* Update l2trace.go
* Refactor l2witness/opt-storage-proof (#112 )
* rename GetStateData to GetLiveStateObject
* revert EvmTxTraces type
* rename GetLiveStateObject to GetLiveStateAccount
* fix typo
* some renamings
* format codes
* fix typo
* fix typos
* format codes
some reverts
some renamings
some renamings
format codes
* update comments
update comments
* update comments
update comments
update comments
* update comments
update comments
update comments
* rename
* rename
* update
* update comments
Co-authored-by: maskpp <maskpp266@gmail.com>
Co-authored-by: Ho Vei <noelwei@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2022-06-08 12:26:50 +08:00
maskpp
9b99f2e174
fix bug and optimize fill_trace logic for gc ( #104 )
...
* fix bug and upgrade trace code
* minor
* refactor (#105 )
* move
* add comments
* fix typo
* update comments
* rename extraData()
* update comments
Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2022-05-26 10:35:27 +08:00
maskpp
9199413d21
opt: improve trace handling logic to decrease GC pressure. ( #92 )
...
* Upgrade trace code to decrease GC pressure.
* Fix golangci bug
* Add goproxy
* update docker file
* trigger ci
* trigger ci
* Upgrade code
* Upgrade code
* trigger ci
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2022-05-18 22:38:15 +08:00
maskpp
a79e72f697
refactor: optimize and improve tps for contract call. ( #83 )
...
* upgrade block trace
* upgrade block trace
* Correct comments
2022-05-04 10:12:17 +08:00
HAOYUatHZ
06190d0642
fix FormatLogs memory ( #75 )
2022-04-02 11:25:07 +08:00
HAOYUatHZ
3d3c9d3edf
fix bigInt encoding ( #74 )
...
* fix bigInt encoding
* fix balance
2022-04-02 10:13:04 +08:00
HAOYUatHZ
33fcd2bf6d
fix(trace): use string for big.Int ( #72 )
2022-04-01 16:56:01 +08:00
maskpp
40e8f088b6
opt: upgrade blockResult process flow ( #68 )
...
* upgrade blockResult process flow
* fix format optimization
2022-03-31 18:01:14 +08:00
maskpp
fccb5bf6ec
fix bug about get the trace of opcode ( #67 )
2022-03-31 15:00:55 +08:00
HAOYUatHZ
9f1d8552e4
feat: add RefundCounter to StructLogRes ( #66 )
2022-03-31 13:11:34 +08:00
HAOYUatHZ
360115e61f
add code_hash to trace
2022-03-30 15:17:57 +08:00
Steven
5128154925
fix CaptureState ( #56 )
...
* Move code of `captureStateAfter` to `captureState`, and refactor some
code.
* Fix to use the right key in `traceStorageProof`.
* clean up
* Update `capatureStateAfter`.
* fix
* fix
* Get storage key from stack of last log.
* Revert wrong fix.
* minor
Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
2022-03-28 23:02:48 +08:00
Steven
b6cc89fabe
Add goimports lint ( #54 )
...
* Add `goimports` lint.
* Fix `goimports` issue.
* Fix group to `github.com/scroll-tech/go-thereum`.
2022-03-24 16:53:59 +08:00
HAOYUatHZ
f8532484a6
improve doc for OpcodeExecs ( #48 )
2022-03-21 13:10:11 +08:00
HAOYUatHZ
13ea5c234b
fix(trace): update proofList struct ( #46 )
2022-03-19 13:28:25 +08:00
HAOYUatHZ
a5999cee90
fix(trace): change codeHash to code ( #44 )
2022-03-16 16:17:50 +08:00
maskpp
69c291cf7a
feat: add more data into the execution trace ( #20 )
2022-02-21 10:15:57 +08:00
maskpp
7745fd5840
Extract execution trace from EVM execution and provide subscription API ( #19 )
...
* Create go.yml
* Merge from zkrollup and fix conflict
* go mod tidy
* fix worker_test test case
* fix worker_test test case
* Delete go.yml
* add log content, enable memory trace
* add tracer pool handler
* Add comments and format code
* add evmTrace subscribe api
* Move the evmTrace struct.
* Fix miner bug.
* upgrade evmTrace api
* fix bug about evmTracesByHash api
* Fix the bug about block.timestamp and remove unnecessary copy.
* Update eth/filters/api.go
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
* Upgrade comments.
* Delete useless code in test file
* Update miner/worker.go
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
* Change the return result to BlockResult.
* Change return type.
* Change blockResult to blockResults.
* Add ReturnValue.
* Update core/rawdb/l2trace.go
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
* Update core/rawdb/l2trace.go
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
* Update core/types/l2trace.go
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
* Add indent to the comment and rm json encoding flag.
* Rm json encoding flag.
* Update core/rawdb/l2trace.go
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
* Rm json encoding flag.
* Update ethclient/ethclient.go
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
* Update eth/filters/api.go
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
* Use as the blockResult prefix flag.
* Update eth/filters/filter_system.go
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
* Update eth/filters/filter_system.go
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
* Update ethclient/ethclient.go
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
* Update eth/filters/api.go
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
Co-authored-by: Haichen Shen <shenhaichen@gmail.com>
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com>
2022-01-23 20:41:15 +08:00
maskpp
b4d60884d2
Fix import fmt and run tests for given architecture ( #18 )
...
* fix gofmt
* Run tests for given architecture
* Speed up CI execution.
2022-01-12 19:45:06 -08:00
Jules
de7ed6af40
Update mod file and all imports to use scroll-tech URL ( #15 )
...
* Update mod file and all imports to use scroll-tech URL
Fixes #14
* Update Discord link
2021-12-24 10:59:22 +01:00
Martin Holst Swende
ab31fbbde1
core/vm: don't use iota for opcode definitions
2021-11-18 09:50:52 +01:00
Andrei Maiboroda
f32feeb260
core/vm: implement EIP-2681: Limit account nonce to 2^64-1 ( #23853 )
...
This retroactively implements requirements or EIP-2681 for the account nonce upper limit.
2021-11-11 15:00:58 +01:00
Martin Holst Swende
6b9c77f060
eth/tracers: package restructuring ( #23857 )
...
* eth/tracers: restructure tracer package
* core/vm/runtime: load js tracers
* eth/tracers: mv bigint js code to own file
* eth/tracers: add method docs for native tracers
* eth/tracers: minor doc fix
* core,eth: cancel evm on nativecalltracer stop
* core/vm: fix failing test
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
2021-11-09 12:09:35 +01:00
Sina Mahmoodi
8d7e6062ec
eth/tracers: support for golang tracers + add golang callTracer ( #23708 )
...
* eth/tracers: add basic native loader
* eth/tracers: add GetResult to tracer interface
* eth/tracers: add native call tracer
* eth/tracers: fix call tracer json result
* eth/tracers: minor fix
* eth/tracers: fix
* eth/tracers: fix benchTracer
* eth/tracers: test native call tracer
* eth/tracers: fix
* eth/tracers: rm extra make
Co-authored-by: Martin Holst Swende <martin@swende.se>
* eth/tracers: rm extra make
* eth/tracers: make callFrame private
* eth/tracers: clean-up and comments
* eth/tracers: add license
* eth/tracers: rework the model a bit
* eth/tracers: move tracecall tests to subpackage
* cmd/geth: load native tracers
* eth/tracers: minor fix
* eth/tracers: impl stop
* eth/tracers: add native noop tracer
* renamings
Co-authored-by: Martin Holst Swende <martin@swende.se>
* eth/tracers: more renamings
* eth/tracers: make jstracer non-exported, avoid cast
* eth/tracers, core/vm: rename vm.Tracer to vm.EVMLogger for clarity
* eth/tracers: minor comment fix
* eth/tracers/testing: lint nitpicks
* core,eth: cancel evm on nativecalltracer stop
* Revert "core,eth: cancel evm on nativecalltracer stop"
This reverts commit 01bb908790 .
* eth/tracers: linter nits
* eth/tracers: fix output on err
Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-11-05 11:48:21 +01:00
Martin Holst Swende
551bd6e721
eth/tracers: invoke enter/exit on 0-value calls to inex accounts ( #23828 )
2021-11-01 19:06:33 +01:00
Sina Mahmoodi
401354976b
core,eth: call frame tracing ( #23087 )
...
This change introduces 2 new optional methods; `enter()` and `exit()` for js tracers, and makes `step()` optiona. The two new methods are invoked when entering and exiting a call frame (but not invoked for the outermost scope, which has it's own methods). Currently these are the data fields passed to each of them:
enter: type (opcode), from, to, input, gas, value
exit: output, gasUsed, error
The PR also comes with a re-write of the callTracer. As a backup we keep the previous tracing script under the name `callTracerLegacy`. Behaviour of both tracers are equivalent for the most part, although there are some small differences (improvements), where the new tracer is more correct / has more information.
2021-09-17 09:31:22 +02:00
Marius van der Wijden
b8d7c662cd
core, rpc: disable memory output by default in traces ( #23558 )
...
* core: cmd: invert disableMemory
* core: fix missed inversion
* cmd/evm: preserve Flags but change default value
* Apply suggestions from code review
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-09-13 18:59:52 +02:00
Paweł Bylica
3258211f68
core/vm: rework jumpdest analysis benchmarks ( #23499 )
...
* core/vm: rework jumpdest analysis benchmarks
For BenchmarkJumpdestOpAnalysis use fixed code size of ~1.2MB
and classic benchmark loop.
* core/vm: clear bitvec in jumpdest analysis benchmark
2021-08-30 14:13:06 +02:00
Guillaume Ballet
0b40977480
core/vm: fix typo in comment ( #23450 )
2021-08-24 13:57:05 +02:00
Martin Holst Swende
1d99573192
core/vm: faster code analysis ( #23381 )
...
* core/vm: more detailed benchmark for jumpdest analysis
* core/vm: make jd analysis benchmark alloc free
* core/vm: improve jumpdest analysis
* core/vm: improve worst-case
* core/vm: further improvements in analysis
* core/vm: improve jumpdest analysis >PUSH15
* core/vm: make jd analysis ref by value
* core/vm: fix misspell
* core/vm: improve set8 and set16 a bit
* core/vm: reduce amount of code
* core/vm: optimize byte copying
2021-08-24 10:00:10 +03:00
Marius van der Wijden
2faf796d2a
internal/ethapi: fix panic in accesslist creation ( #23225 )
...
* internal/ethapi: revert + fix properly in al tracer
* internal/ethapi: use toMessage instead of creating new message
* internal/ethapi: remove ineffassign
* core: fix invalid unmarshalling, fix test
Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-07-28 14:21:35 +02:00
Sina Mahmoodi
5441a8fa47
all: remove noop vm config flags ( #23111 )
...
* all: rm external interpreter and ewasm config
* core/vm: rm Interpreter interface
* cmd/geth: deprecate interpreter config fields
2021-07-06 22:03:09 +02:00
Martin Holst Swende
f5f906dd0d
eth/tracers: improve tracing performance ( #23016 )
...
Improves the performance of debug.traceTransaction
2021-07-01 09:15:04 +02:00
Li Dongwei
bca8c03e57
core/state: remove unused methods ReturnGas, GetStorageProofByHash ( #23092 )
...
Co-authored-by: lidongwei <lidongwei@huobi.com>
2021-06-25 14:34:09 +02:00
Martin Holst Swende
080b6ebe91
core/vm: evm fix panic ( #23047 )
...
* core/vm: evm fix panic
* core/vm/runtime: default to params.initialbasefee
2021-06-16 09:53:27 +03:00