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

Mobile discovery improvements #1132

Merged
merged 11 commits into from
Sep 1, 2020
Merged

Mobile discovery improvements #1132

merged 11 commits into from
Sep 1, 2020

Conversation

tkporter
Copy link
Contributor

@tkporter tkporter commented Aug 7, 2020

Description

When a mobile app using mobile geth is closed entirely, it does not gracefully shut down. As a result, the server pool entries were not being properly persisted & loaded upon startup.

This PR:

  • Adds the les_serverPoolEntries RPC to a new private LES client API to easily view server pool entries
  • Saves server pool entries when there is an update to the list of entries that have at least attempted to have been made peers. This is fairly infrequent (there are max 5 entries)
  • Allows the creation of an HTTP RPC server on mobile for debugging

Other changes

Looks like some go.mod/go.sum changes were made automatically, not sure if these are undesirable

I'm still testing this more but wanted to put the PR out

Tested

Ran on apps & peered more quickly when properly saving server pool entries

Related issues

Backwards compatibility

Backward compatible

Copy link
Contributor

@nategraf nategraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should geth-sources.jar be committed, or was that an accident? go.sum changed as a result of go.mod adding golang.org/x/mobile. That's expected.

les/client.go Show resolved Hide resolved
les/serverpool.go Outdated Show resolved Hide resolved
@tkporter tkporter merged commit 18acd7b into master Sep 1, 2020
@tkporter tkporter deleted the trevor/mobile-disc-2020 branch September 1, 2020 20:34
mergify bot pushed a commit to celo-org/celo-monorepo that referenced this pull request Sep 2, 2020
### Description

Should not be merged until valora-inc/react-native-geth#28 is merged (which itself relies upon celo-org/celo-blockchain#1132), and then the react-native-geth version in this PR will be updated.

This uses the enodes that are used for static nodes as bootnodes for discovery. The current bootnodes that are deployed do not support the type of discovery required by mobile clients (discovery v5), but the static nodes do. Having more nodes as bootnodes will also help with discovery speed & diversity of the nodes discovered.

When testing on baklava with both static nodes and discovery enabled, peering was nearly immediate. When only testing with discovery enabled and no static nodes, peering was very quick (< a few seconds). A few times I found when only relying upon discovery that no peers would be found, so I recommend keeping static nodes & discovery for the time being.

### Other changes

I added some instructions on how to attach to the geth instance on the app.

### Tested

Ran a lot on android & iOS devices

### Related issues

### Backwards compatibility

Requires updates from react-native-geth (valora-inc/react-native-geth#28) and celo-blockchain (celo-org/celo-blockchain#1132) to work as intended
@mcortesi mcortesi added this to the 1.0.2 milestone Sep 24, 2020
ewilz pushed a commit to ewilz/celo-monorepo that referenced this pull request Sep 29, 2020
### Description

Should not be merged until valora-inc/react-native-geth#28 is merged (which itself relies upon celo-org/celo-blockchain#1132), and then the react-native-geth version in this PR will be updated.

This uses the enodes that are used for static nodes as bootnodes for discovery. The current bootnodes that are deployed do not support the type of discovery required by mobile clients (discovery v5), but the static nodes do. Having more nodes as bootnodes will also help with discovery speed & diversity of the nodes discovered.

When testing on baklava with both static nodes and discovery enabled, peering was nearly immediate. When only testing with discovery enabled and no static nodes, peering was very quick (< a few seconds). A few times I found when only relying upon discovery that no peers would be found, so I recommend keeping static nodes & discovery for the time being.

### Other changes

I added some instructions on how to attach to the geth instance on the app.

### Tested

Ran a lot on android & iOS devices

### Related issues

### Backwards compatibility

Requires updates from react-native-geth (valora-inc/react-native-geth#28) and celo-blockchain (celo-org/celo-blockchain#1132) to work as intended
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants