-
Notifications
You must be signed in to change notification settings - Fork 107
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
add support for wasm compile targets #339
Conversation
core/state/database_arbitrum.go
Outdated
@@ -7,16 +7,11 @@ import ( | |||
"github.com/ethereum/go-ethereum/core/rawdb" | |||
) | |||
|
|||
func (db *cachingDB) ActivatedAsm(moduleHash common.Hash) ([]byte, error) { | |||
func (db *cachingDB) ActivatedAsm(targetName string, moduleHash common.Hash) ([]byte, error) { | |||
if asm, _ := db.activatedAsmCache.Get(moduleHash); len(asm) > 0 { |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
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.
very good.
tiny suggestions
const ( | ||
TargetWavm = "wavm" | ||
TargetArm = "arm" | ||
TargetX86 = "x86" |
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.
not 100% certain - but I think maybe TargetArm and TargetAsm should be identical to the runtime.GOARCH on arm64/x86 architectures, which will be compatible with some exiting code
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.
I used GOARCH strings + I renamed the constants to TargetArm64 and TargetAmd64 to make it more consistent
the new version of schema is sort of compatible with previous version - opening old schema will be detected as empty database, so we don't need to increase the version number note: previously the version key didn't exist, for that case version 0 is returned when trying to read the version
This reverts commit c4c2994.
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.
Looks good, just minor comments.
Co-authored-by: Gabriel de Quadros Ligneul <[email protected]>
Co-authored-by: Gabriel de Quadros Ligneul <[email protected]>
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.
LGTM
if dbErr == nil { | ||
asmMap[target] = asm | ||
} else { | ||
err = errors.Join(fmt.Errorf("failed to read activated asm from database for target %v and module %v: %w", target, moduleHash, dbErr), err) |
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.
Side note, but I had no idea errors.Join
existed, that's really helpful!
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.
I hadn't either, saw that during some other PR review :) It solves the multiple errors issue quite ok: not sure if that is formatted nicely when logged, but full errors information is preserved
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.
LGTM (pending nitro PR approval)
part of NIT-2631
This PR: