-
Notifications
You must be signed in to change notification settings - Fork 48
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
Non-osaka EOF changes #179
Conversation
Adds EOF changes that don't depend on Geth EOF support or the Osaka activation. * opcodes for EOF * better immediate handling for opcodes * EIP-7756 flexibility on opcode and gas * EIP-7756 fields (section and functionDepth)
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.
Thanks for this!
@@ -112,7 +112,13 @@ func (vm *BesuVM) ParseStateRoot(data []byte) (string, error) { | |||
root := string(data[start : start+2+64]) | |||
return root, nil | |||
} | |||
return "", errors.New("besu: no stateroot found") | |||
start = strings.Index(string(data), `"stateRoot":"`) |
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.
Do you have any example statetest which makes besu emit this? Or is that an opcoming change?
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.
hyperledger/besu#8006 - will land in main after new year
evms/marshalling.go
Outdated
// Depends on Geth EOF support | ||
// Even then, not essential to diffing |
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.
It doesn't really depend on geth support. You can do like I do with the globals, e.g ClearGascost
.
// Besu sometimes reports GasCost of 0x7fffffffffffffff, along with ,"error":"Out of gas"
ClearGascost = true
So you add IgnoreEOF = true
, in the constants, and
if !IgnoreEOF {
if log.Section != 0 {
b = append(b, []byte(`,"section":`)...)
b = strconv.AppendUint(b, uint64(log.Section), 10)
}
if log.FunctionDepth ...
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.
Will do. Some of the commented out code depends on types from go-ethereum code. Those will remain commented out.
evms/gen_oplog.go
Outdated
@@ -75,8 +83,14 @@ func (o *opLog) UnmarshalJSON(input []byte) error { | |||
if dec.Pc != nil { | |||
o.Pc = *dec.Pc | |||
} | |||
// Depends on Geth EOF support |
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.
Does it? We can enable this, I think, as long as we don't use it for diffing later on
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.
This one will be fixed, it's from goevmlab code.
@@ -79,6 +79,9 @@ func (t *TraceLine) Get(title string) string { | |||
return fmt.Sprintf("%v (0x%x)", op.Pc/ChunkSize, op.Pc/ChunkSize) | |||
case "pc": | |||
return fmt.Sprintf("%v (0x%x)", op.Pc, op.Pc) | |||
// Depends on Geth EOF support |
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.
Does it really? this can be enabled, no? (and same below)
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 type comes from Geth. The ones that remain after my next push are all because the types need to be in Geth.
ui/viewmanager.go
Outdated
@@ -204,7 +204,7 @@ func (mgr *viewManager) onStepSelected(line *traces.TraceLine) { | |||
mgr.opView.AddFormItem(field) | |||
} | |||
|
|||
for _, l := range []string{"pc", "opcode", "opName", "gasCost", "gas", "memSize", "addr"} { | |||
for _, l := range []string{"pc", "section", "opcode", "opName", "gasCost", "gas", "memSize", "addr", "functionDepth"} { |
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.
Depending on whether IgnoreEOF
is set, we could use different headings?
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.
Done
Adds EOF changes that don't depend on Geth EOF support or the Osaka activation.