Commit graph

1574 commits

Author SHA1 Message Date
Wanwiset Peerapatanapokin
8edb76f08d
Revert "core/state: abort commit if errors have occurred (#484)" (#489)
This reverts commit 0114ecabd0.
2024-03-13 11:54:09 +04:00
Daniel Liu
4616d59935 internal/ethapi: support block number or hash on state-related methods (#19491)
* Support for EIP-1898.
2024-03-12 10:40:03 +08:00
Wanwiset Peerapatanapokin
0114ecabd0
core/state: abort commit if errors have occurred (#484) 2024-03-11 13:19:24 +04:00
Wanwiset Peerapatanapokin
910d415653
Missing json Field Tags in Marshalled Struct (#475) 2024-03-08 15:38:33 +04:00
Daniel Liu
6a2f753cee
Merge pull request #472 from XinFinOrg/eip3855
core/vm: implement EIP-3855: PUSH0 instruction.
2024-03-07 23:01:33 +08:00
geruiwang
863d4f14e3 eth/tracers/js: fix isPush for push0 (#28520)
Fixes so that `push0` opcode is correctly reported as `true` by the `IsPush` function

---------

Co-authored-by: Martin Holst Swende <martin@swende.se>
2024-03-07 22:31:19 +08:00
geruiwang
968440ce3d core/vm: implement EIP-3855: PUSH0 instruction. 2024-03-07 21:44:37 +08:00
Wang Gerui
0e36b5be42 fix typo in EIPs 2024-03-07 21:37:33 +08:00
Wanwiset Peerapatanapokin
ae10d7090c
Rollback privacy (#477)
Rollback the previous test removal or privacy package on devnet.

This reverts commit 4f79e535b37dc85144e2d38c2f2570b0ce4305b2.

This reverts commit 5a2722c268ec4f03f3117b1af2dee2411af4b13a.
2024-03-07 10:40:55 +04:00
Daniel Liu
ece58f00b5 ethapi: add method eth_getAccountInfo 2024-03-06 14:11:15 +08:00
Daniel Liu
bbe08ac6e6 core/state: add function GetStorageRoot 2024-03-06 14:10:08 +08:00
Liam
38a192e672
Merge pull request #459 from XinFinOrg/eip4399
implement EIP-4399, PREVRANDAO opcode
2024-03-04 17:50:56 +11:00
Wanwiset Peerapatanapokin
b86c7f646f
Try remove privacy pkg (#466)
* try removing privacy pkg

* rm more reference

* trigger CI
2024-03-04 07:59:45 +04:00
Gerui Wang
a31489541d implement EIP-4399, PREVRANDAO opcode.
and remove unused LondonBlock and BerlinBlock in `params/config.go` (already defined in constants.go)
2024-03-04 00:32:14 +08:00
Daniel Liu
928a0691ca implement EIP-3198 2024-03-01 15:04:32 +08:00
lmittmann
b36678f7ad core/vm: performance tweak of OpCode.String() (#28453)
make `opCodeToString` a `[256]string` array

Co-authored-by: lmittmann <lmittmann@users.noreply.github.com>
2024-03-01 14:13:24 +08:00
Leon
8b6db6d87a core/vm: better handle error on eip activation check (#25131)
* core/vm: correct logic for eip check of NewEVMInterpreter

* refactor
2024-03-01 14:13:24 +08:00
Qian Bin
032b98e942 core/vm: optimize Memory.Set32 (#24847)
* core/vm: remove unnecessary memset for Memory.Set32

* core/vm: optimize Memory.Set32
2024-03-01 14:13:24 +08:00
s7v7nislands
62b62da730 core/vm: separate opcode group for 0x20 range (#24850) 2024-03-01 14:13:24 +08:00
s7v7nislands
ac35f0ecec core/vm: clean up some dead functions (#24851) 2024-03-01 14:13:24 +08:00
Andrei Maiboroda
b022ba2c5d 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>
2024-03-01 14:13:24 +08:00
Paweł Bylica
6e92486296 core/vm: reverse bit order in bytes of code bitmap (#24120)
* core/vm: reverse bit order in bytes of code bitmap

This bit order is more natural for bit manipulation operations and we
can eliminate some small number of CPU instructions.

* core/vm: drop lookup table
2024-03-01 14:13:24 +08:00
Alex Beregszaszi
2ce30010bc core/vm: remove unused code (IsStaticJump) (#24085) 2024-03-01 14:13:24 +08:00
Martin Holst Swende
fbc1cc11ba core/vm: remove no-recursion option from config (24066) 2024-03-01 14:13:24 +08:00
Andrei Maiboroda
4c27910a77 core/vm: move interpreter interruption check to jump instructions (#24026)
* core/vm: Remove interpreter loop interruption check

* core/vm: Unit test for interpreter loop interruption

* core/vm: Check for interpreter loop abort on every jump
2024-03-01 14:13:24 +08:00
Paweł Bylica
7d3c783bb9 core/vm: fill gaps in jump table with opUndefined (#24031) 2024-03-01 14:13:24 +08:00
Alex Beregszaszi
ae267d3da7 core/vm: remove stack.pushN (#24040) 2024-03-01 14:13:24 +08:00
Alex Beregszaszi
b1c03864e6 core/vm: rename opSuicide to opSelfdestruct (#24022)
The opcode was renamed in the codebase in 2017, but the functions were kept unchanged.
2024-03-01 14:13:24 +08:00
Alex Beregszaszi
bfbb678309 core/vm: move interpreter.ReadOnly check into the opcode implementations (#23970)
* core/vm: Move interpreter.ReadOnly check into the opcode implementations

Also remove the same check from the interpreter inner loop.

* core/vm: Remove obsolete operation.writes flag

* core/vm: Capture fault states in logger

Co-authored-by: Martin Holst Swende <martin@swende.se>

* core/vm: Remove panic added for testing

Co-authored-by: Martin Holst Swende <martin@swende.se>
2024-03-01 14:13:24 +08:00
Andrei Maiboroda
002be52ae9 core/vm: don't copy JumpTable when no EIP mods are needed (#23977) 2024-03-01 14:13:24 +08:00
Alex Beregszaszi
c097e565fd core/vm: rename SHA3 instruction to KECCAK256 (#23976)
This was proposed in 2016, Solidity uses this since 2017, and evmone and other VMs use the keccak256 name. This brings geth in line with those.
2024-03-01 14:13:24 +08:00
Paweł Bylica
823ec33484 core/vm: simplify error handling in interpreter loop (#23952)
* core/vm: break loop on any error

* core/vm: move ErrExecutionReverted to opRevert()

* core/vm: use "stop token" to stop the loop

* core/vm: unconditionally pc++ in the loop

* core/vm: set return data in instruction impls
2024-03-01 14:13:24 +08:00
Andrei Maiboroda
6415934da9 core/vm: simplify op lookup in contract (#23974) 2024-03-01 14:13:23 +08:00
Martin Holst Swende
f7c6b1abd4 core/vm, core/state/snapshot: remove unused code (#23956)
* core/state/snapshot: remove wiper functionality

* core/vm: remove unused 'unofficial' opcodes
2024-03-01 14:13:23 +08:00
Paweł Bylica
3d3cc6c6d7 core/vm: use proper JumpTable type (#23967) 2024-03-01 14:13:23 +08:00
Martin Holst Swende
f9e14af6fd core/vm: don't use iota for opcode definitions (#23928) 2024-03-01 14:13:23 +08:00
Paweł Bylica
dc8cdf3e62 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
2024-03-01 14:13:23 +08:00
Guillaume Ballet
f05fa009e2 core/vm: fix typo in comment (#23450) 2024-03-01 14:13:23 +08:00
Daniel Liu
7a55b9f788 core/state: remove unused methods ReturnGas (#23092) 2024-03-01 14:13:23 +08:00
Evgeny Danilenko
21bbe5f568 core/vm: avoid duplicate log in json logger (#22825) 2024-03-01 14:13:23 +08:00
aaronbuchwald
7c6908b959 core/vm: fix interpreter comments (#22797)
* Fix interpreter comment

* Fix comment
2024-03-01 14:13:23 +08:00
Paweł Bylica
9c8d228dda core/vm: clean up contract creation error handling (#22766)
Do not keep separate flag for "max code size exceeded" case, but instead
assign appropriate error for it sooner.
2024-03-01 14:13:23 +08:00
aaronbuchwald
6077ecb195 core/vm: replace repeated string with variable in tests (#22774) 2024-03-01 14:13:23 +08:00
Martin Holst Swende
446b9e86f4 core/vm, params: make 2200 in line with spec (#21605) 2024-03-01 14:13:23 +08:00
Péter Szilágyi
06d5da016c core/vm: use pointers to operations vs. copy by value (#21336) 2024-03-01 14:13:23 +08:00
Paweł Bylica
192edc0c63 core/vm: use uint256 in EVM implementation (#20787)
* core/vm: use fixed uint256 library instead of big

* core/vm: remove intpools

* core/vm: upgrade uint256, fixes uint256.NewFromBig

* core/vm: use uint256.Int by value in Stack

* core/vm: upgrade uint256 to v1.0.0

* core/vm: don't preallocate space for 1024 stack items (only 16)

Co-authored-by: Martin Holst Swende <martin@swende.se>
2024-03-01 14:13:23 +08:00
Daniel Liu
3f10de24b0 core/vm/privacy: fix test case in ringct_test.go (#424) 2024-02-19 10:52:33 +08:00
Liam
9eea134daa
Merge pull request #424 from gzliudan/RIN-07
check parameters not to be nil when call function curve.Add
2024-02-12 22:23:34 +11:00
Wanwiset Peerapatanapokin
b272e7418c
Fix curve (#429)
* update secp256k1 library from go-eth code

* cast deprecated functions to use new BitCurve type

* add IsOnCurve checks and tests

* add test outcome check

* fix test
2024-02-11 15:59:28 +04:00
Wanwiset Peerapatanapokin
30581274a1
RIN-08 RIN-10 RIN-11 Fix curve issues (#425)
* update secp256k1 library from go-eth code

* cast deprecated functions to use new BitCurve type

* add IsOnCurve checks and tests

* add test outcome check
2024-02-11 01:51:11 +04:00