-
Notifications
You must be signed in to change notification settings - Fork 250
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
Nimbus integration #4254
base: develop
Are you sure you want to change the base?
Nimbus integration #4254
Conversation
Jenkins BuildsClick to see older builds (23)
|
04631f7
to
5aec7ce
Compare
5aec7ce
to
a44e50b
Compare
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 we need to update the migration file timestamp here before we can merge this file?
You need to rebase this PR, it won't run with old CI labels. |
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.
Interesting feature!
What would happen in mobile if we merge this PR? would this version still be usable?
I'm also not entirely sure how packaging nimbus would work when generating the gomobile bindings.
// Run light client proxy | ||
ctx, cancel := context.WithCancel(context.Background()) | ||
proceed: | ||
fmt.Println("after waitForProxyHeaders") |
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.
Should probably be a debug log?
fmt.Println("after waitForProxyHeaders") | |
fmt.Println("after waitForProxyHeaders") |
// Let's check if handlers have been installed | ||
_, found := client.handler("eth_getBalance") | ||
if found { | ||
fmt.Println("Proceed") |
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.
Debug log instead of Println
@@ -88,7 +88,7 @@ require ( | |||
github.com/meirf/gopart v0.0.0-20180520194036-37e9492a85a8 | |||
github.com/mutecomm/go-sqlcipher/v4 v4.4.2 | |||
github.com/schollz/peerdiscovery v1.7.0 | |||
github.com/siphiuel/lc-proxy-wrapper v0.0.0-20230516150924-246507cee8c7 | |||
github.com/vitvly/lc-proxy-wrapper v0.0.0-20240210131537-0f48377f5a71 |
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 repo has no license. Probably a good idea to add a MIT/Apache2 and/or move it into status-im
@@ -312,7 +312,7 @@ func (n *StatusNode) setupRPCClient() (err error) { | |||
if err != nil { | |||
return | |||
} | |||
n.rpcClient, err = rpc.NewClient(gethNodeClient, n.config.NetworkID, n.config.UpstreamConfig, n.config.Networks, n.appDB) | |||
n.rpcClient, err = rpc.NewClient(gethNodeClient, n.config.NetworkID, n.config.UpstreamConfig, n.config.Networks, n.config.NimbusProxyConfig.Enabled, n.appDB) |
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 wonder if at this point if it wouldn't be a good idea to create a config object instead of adding more parameters to the function?
if err != nil { | ||
return "", 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.
Is it possible for this query to return no rows and be valid? because you might get a sql.ErrNoRows
so I wonder if we should add a
if errors.Is(err, sql.ErrNoRows) {
return "", nil
}
|
||
blockRoot, err := nodecfg.GetNimbusTrustedBlockRoot(c.db) | ||
if err != nil { | ||
fmt.Println("verif_proxy GetNimbusTrustedBlockRoot error", 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.
Error log instead of Println
if !proxyInitialized { | ||
proxyInitialized = true | ||
// Create RPC client using verification proxy endpoint | ||
endpoint := "http://" + cfg.RpcAddress + ":" + fmt.Sprint(cfg.RpcPort) |
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.
endpoint := "http://" + cfg.RpcAddress + ":" + fmt.Sprint(cfg.RpcPort) | |
endpoint := fmt.Sprintf("http://%s:%d", cfg.RpcAddress, cfg.RpcPort) |
if proxyInitialized && ev.EventType == proxytypes.FinalizedHeader { | ||
err = storeUpdatedBlockRoot(c, ev.Msg) | ||
if err != nil { | ||
fmt.Println("verif_proxy storeUpdatedBlockRoot", 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.
Error log instead of println
// Invoke a simple RPC method in order to ascertain that proxy is up and running | ||
ctx, _ := context.WithTimeout(c.ctx, 5*time.Second) | ||
_, err := blockNumber(ctx, proxyClient) | ||
fmt.Println("verif_proxy blockNumber result", 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.
Error log instead of println, only if err != nil
Hi @vitvly, |
@friofry hi, i will push updated PR with review comments fixed and hopefully it can be merged. |
This PR updates the nimbus interaction layer to use the most recent version of Nimbus proxy
Also
Client
.