Skip to content
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

Can't get syncStatus on mobile #24176

Closed
markusbug opened this issue Jan 1, 2022 · 1 comment
Closed

Can't get syncStatus on mobile #24176

markusbug opened this issue Jan 1, 2022 · 1 comment
Labels

Comments

@markusbug
Copy link

System information

Geth version: GethDroid/v1.10.15-unstable/android-arm64/go1.17.3
OS & Version: Android

Expected behaviour

Should return a SyncProgress Object.

Actual behaviour

Fails with this message:

Caused by: go.Universe$proxyerror: json: cannot unmarshal string into Go struct field SyncProgress.CurrentBlock of type uint64
        at geth.EthereumClient.syncProgress(Native Method)

Steps to reproduce the behaviour

  • Bind the mobile code with gomobile into an .aar file.
  • Import .aar file into android studio project
  • Get SyncProgress in Java

You can get the SyncProgress using this Code:

import geth.*;

Node node = Geth.newNode(getFilesDir()+"/.ethNode", nodeConfig);
node.start();

Context ctx = Geth.newContext();
SyncProgress syncProgress = node.getEthereumClient().syncProgress(ctx);

Backtrace

Caused by: go.Universe$proxyerror: json: cannot unmarshal string into Go struct field SyncProgress.CurrentBlock of type uint64
        at geth.EthereumClient.syncProgress(Native Method)
@fjl
Copy link
Contributor

fjl commented Jan 3, 2022

Closing because the underlying issue is #24180

@fjl fjl closed this as completed Jan 3, 2022
fjl added a commit that referenced this issue Jan 5, 2022
SyncProgress was modified in PR #23576 to add the fields reported for
snap sync. The PR also changed ethclient to use the SyncProgress struct
directly instead of wrapping it for hex-decoding. This broke the
SyncProgress method.

Fix it by putting back the custom wrapper. While here, also put back the
fast sync related fields because SyncProgress is stable API and thus
removing fields is not allowed.

Fixes #24180
Fixes #24176
sidhujag pushed a commit to syscoin/go-ethereum that referenced this issue Jan 6, 2022
SyncProgress was modified in PR ethereum#23576 to add the fields reported for
snap sync. The PR also changed ethclient to use the SyncProgress struct
directly instead of wrapping it for hex-decoding. This broke the
SyncProgress method.

Fix it by putting back the custom wrapper. While here, also put back the
fast sync related fields because SyncProgress is stable API and thus
removing fields is not allowed.

Fixes ethereum#24180
Fixes ethereum#24176
JacekGlen pushed a commit to JacekGlen/go-ethereum that referenced this issue May 26, 2022
SyncProgress was modified in PR ethereum#23576 to add the fields reported for
snap sync. The PR also changed ethclient to use the SyncProgress struct
directly instead of wrapping it for hex-decoding. This broke the
SyncProgress method.

Fix it by putting back the custom wrapper. While here, also put back the
fast sync related fields because SyncProgress is stable API and thus
removing fields is not allowed.

Fixes ethereum#24180
Fixes ethereum#24176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants