-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
all: sync with upstream #1138
all: sync with upstream #1138
Conversation
This PR significantly reduces the memory consumption of a long reorg
core/vm: optimize PUSH opcode discrimination
Move locking into trieDB insert function
* eth/filters: fix pending for getLogs * add pending method to test backend * fix block range validation
accounts/url: add test logic what check null string to parseURL()
* common: improve pretty duration regex * common: improve pretty duration regex
@@ -76,7 +76,7 @@ func codeBitmapInternal(code, bits bitvec) bitvec { | |||
for pc := uint64(0); pc < uint64(len(code)); { | |||
op := OpCode(code[pc]) | |||
pc++ | |||
if op < PUSH1 || op > PUSH32 { | |||
if int8(op) < int8(PUSH1) { // If not PUSH (the int8(op) > int(PUSH32) is always false). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If not PUSH (the int8(op) > int(PUSH32) is always false)
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The opcode of "PUSH1" is "0x60", and all the other PUSH
opcodes have a greater opCode than "PUSH1". An opcode that is less than "0x60" can never be a "PUSH32" .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but op > PUSH32
could be true, right? say if op is Dup1(0x80), while PUSH32 is 0x7f.
Yes. You are right.
After realizing that I was wrong about this, I did a little search on this.
I found this function is primarily used for tests. And they never use an opcode greater than PUSH32 in their test cases:
https://github.com/ethereum/go-ethereum/blob/master/core/vm/analysis_test.go#L32
Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Larry ***@***.***>
Sent: Wednesday, October 26, 2022 12:06:01 PM
To: bnb-chain/bsc ***@***.***>
Cc: junnmm ***@***.***>; Comment ***@***.***>
Subject: Re: [bnb-chain/bsc] all: sync with upstream (PR #1138)
@brilliant-lx commented on this pull request.
________________________________
In core/vm/analysis.go<#1138 (comment)>:
@@ -76,7 +76,7 @@ func codeBitmapInternal(code, bits bitvec) bitvec {
for pc := uint64(0); pc < uint64(len(code)); {
op := OpCode(code[pc])
pc++
- if op < PUSH1 || op > PUSH32 {
+ if int8(op) < int8(PUSH1) { // If not PUSH (the int8(op) > int(PUSH32) is always false).
but op > PUSH32 could be true right, say if op is Dup1(0x80)
—
Reply to this email directly, view it on GitHub<#1138 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWVO35TLUFHCX2IMPH22CJTWFCU2TANCNFSM6AAAAAARGMMC5E>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Oh, I think I got.
It is not a bug introduced in benchmark.
0x80 is negative as a signed integer.
Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: junnm na ***@***.***>
Sent: Wednesday, October 26, 2022 8:22:23 PM
To: bnb-chain/bsc ***@***.***>; bnb-chain/bsc ***@***.***>
Cc: Comment ***@***.***>
Subject: Re: [bnb-chain/bsc] all: sync with upstream (PR #1138)
Yes. You are right.
After realizing that I was wrong about this, I did a little search on this.
I found this function is primarily used for tests. And they never use an opcode greater than PUSH32 in their test cases:
https://github.com/ethereum/go-ethereum/blob/master/core/vm/analysis_test.go#L32
Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Larry ***@***.***>
Sent: Wednesday, October 26, 2022 12:06:01 PM
To: bnb-chain/bsc ***@***.***>
Cc: junnmm ***@***.***>; Comment ***@***.***>
Subject: Re: [bnb-chain/bsc] all: sync with upstream (PR #1138)
@brilliant-lx commented on this pull request.
________________________________
In core/vm/analysis.go<#1138 (comment)>:
@@ -76,7 +76,7 @@ func codeBitmapInternal(code, bits bitvec) bitvec {
for pc := uint64(0); pc < uint64(len(code)); {
op := OpCode(code[pc])
pc++
- if op < PUSH1 || op > PUSH32 {
+ if int8(op) < int8(PUSH1) { // If not PUSH (the int8(op) > int(PUSH32) is always false).
but op > PUSH32 could be true right, say if op is Dup1(0x80)
—
Reply to this email directly, view it on GitHub<#1138 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWVO35TLUFHCX2IMPH22CJTWFCU2TANCNFSM6AAAAAARGMMC5E>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Description
Sync with
go-ethereum 1.10.19
:mainly including some bug fixes, and together with some separate
prs
: #1139, #1140, #1141.Rationale
N/A
Example
N/A
Changes
Notable changes:
N/A