Commit graph

1546 commits

Author SHA1 Message Date
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
Banana-J
f453ce8315
fix: missing validation in scalar range check (#417) 2024-02-09 19:56:27 +11:00
Daniel Liu
d440d1d2c6 not pass nil parameters to function curve.Add 2024-02-08 14:50:44 +08:00
Banana-J
ea7d5cc9ad
fix: remove unnecesasry int conversion in the bulletproof.go (#419)
Co-authored-by: wjrjerome <wjrjerome@babylonchain.io>
2024-02-06 22:13:28 +11:00
Liam
fea90a97df
RIN-02 Panic Due to Integer Overflow in Signature Size Calculation (#401)
* RIN-02 Panic Due to Integer Overflow in Signature Size Calculation

* assert the error

* simply overflow check

* simply overflow check

---------

Co-authored-by: Liam Lai <liam.lai@datameshgroup.com>
2024-02-03 10:02:14 +08:00
Banana-J
0664e9fc47
chore: remove the unused false return value from GetCollaterals method (#410) 2024-01-29 11:31:10 +11:00
Banana-J
d70c15667b
chore: remove the unused method in ringct.go (#411) 2024-01-29 11:31:02 +11:00
Banana-J
cac03bd960
fix: GenNewKeyRing should return out of bound error if s and ring size equal in value (#412) 2024-01-29 11:27:48 +11:00
Banana-J
743fc8500b
chore: return statement optimization (#406) 2024-01-28 16:58:41 +11:00
Banana-J
2504961a33
fix: replace all time.after with the time.newtimer (#400) 2024-01-27 21:01:24 +11:00
Daniel Liu
0d7dd867b7
Merge pull request #402 from gzliudan/XDP-02
remove key with empty value from map txs in function NewOrderTransactionByNonce
2024-01-26 10:34:33 +08:00
Daniel Liu
ffa38cd8d1 fix bug and eliminate loop in func PadTo32Bytes 2024-01-24 16:31:13 +08:00
Daniel Liu
e097f2b0df remove key with empty value from map txs in func NewOrderTransactionByNonce 2024-01-24 13:45:50 +08:00
Wanwiset Peerapatanapokin
aaa246f60e
PDF-01 (#397)
* replace deprecated ioutil lib calls

* fix for FileInfo type required

* fix for ioutil.Discard

* fix .Discard

* fix for go-bindata generated files
2024-01-19 15:05:03 +04:00
Liam
81ff6421d0
fix Panic In ProcessOrderPending Leads To Chain Halt (#392)
Co-authored-by: Liam Lai <liamlai@Liams-Laptop.local>
2024-01-19 11:22:24 +11:00
Daniel Liu
ded4e0fd90 fix nil Error in func reportBlock (#369) 2023-12-05 20:29:19 +08:00
Liam
ac404683b3
Merge pull request #365 from XinFinOrg/bump-go-v2
Bump go v1.21
2023-11-21 23:44:14 +11:00
Liam
f7025cee2f
Merge pull request #346 from gzliudan/defer-time.Since
call to time.Since is not deferred
2023-11-21 23:22:58 +11:00
Liam
87ba815341
Merge pull request #336 from gzliudan/fix-func-procFutureBlocks
Fix a loop closure bug in func  procFutureBlocks
2023-11-21 23:19:08 +11:00
Liam Lai
824d7b232f resolve conflict 2023-11-20 23:53:49 +11:00
Liam
c215316744
Make masternode dynamic (#356)
* make masternode dynamic

* fix all the tests

* remove cmt

* fix test again
2023-11-16 23:59:19 +11:00
Liam
84994df759
Merge pull request #351 from XinFinOrg/bump-golang-1.21
Bump golang 1.21
2023-11-07 10:35:42 +11:00
Daniel Liu
cd9f4f8094 core: fix loop closure bug in func procFutureBlocks 2023-11-01 15:02:04 +08:00
Daniel Liu
349f71db7b defer time.Since 2023-11-01 12:43:50 +08:00
Daniel Liu
f4154d0479 remove lendingstate.EmptyAddress 2023-10-24 12:27:03 +08:00
Daniel Liu
2c02ddc2d9 remove xdc0000000000000000000000000000000000000000 2023-10-24 12:15:30 +08:00
Daniel Liu
e2359d9b8c filter zero address in function GetCandidates 2023-10-24 12:15:24 +08:00
Daniel Liu
320b358830 replace package sort with common/sort 2023-10-23 22:51:06 +08:00
Daniel Liu
7adb98fbe8 update gas fee 2023-10-16 11:24:47 +08:00