Skip to content

Mobile discovery improvements#1132

Merged
tkporter merged 11 commits intomasterfrom
trevor/mobile-disc-2020
Sep 1, 2020
Merged

Mobile discovery improvements#1132
tkporter merged 11 commits intomasterfrom
trevor/mobile-disc-2020

Conversation

@tkporter
Copy link
Copy Markdown

@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
Copy Markdown

@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.

Comment thread les/client.go
Comment thread les/serverpool.go Outdated
@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-xyz/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-xyz/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-xyz/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-xyz/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