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

Use new GRPC hub API if it's available #3314

Closed

Conversation

jeffreypicard
Copy link
Collaborator

@jeffreypicard jeffreypicard commented May 31, 2021

To run the go hub tests.
Clone and run the hub from here https://github.com/lbryio/hub using branch "claim_search_port"

  • git clone git@github.com:lbryio/hub.git
  • ./dev.sh
    Alternatively you can build the hub and copy the lbry/wallet/bin in this repo.
  • git clone git@github.com:lbryio/hub.git
  • go build .
  • cp hub <lbry-sdk-location>/lbry/wallet/bin/
    Run the tests
  • export GO_HUB=true
  • python -m unittest discover tests.integration.hub.test_hub_commands
    The claim search tests now also all work with GO_HUB=true set.
  • python -m unittest discover tests.integration.blockchain.test_claim_commands

You can also set HUB_HOST and HUB_PORT, it defaults to localhost:50051

@eukreign
Copy link
Member

eukreign commented Jun 1, 2021

should this be marked as Draft?

@eukreign eukreign assigned jeffreypicard and unassigned eukreign Jun 1, 2021
@jeffreypicard jeffreypicard changed the title Golang claim search tests WIP: Golang claim search tests Jun 1, 2021
@jeffreypicard jeffreypicard marked this pull request as draft June 2, 2021 14:00
@jeffreypicard jeffreypicard changed the title WIP: Golang claim search tests Golang claim search tests Jun 14, 2021
@jeffreypicard jeffreypicard marked this pull request as ready for review June 14, 2021 15:16
@jeffreypicard jeffreypicard requested a review from shyba June 14, 2021 15:33
@jeffreypicard
Copy link
Collaborator Author

Actually, I think the hub needs to be merged and create a release first, so the HubNode can download the latest release from there if needed.

@eukreign
Copy link
Member

all of the automated tests should be green before this is moved out of Draft

@eukreign eukreign marked this pull request as draft June 14, 2021 15:45
Copy link
Member

@eukreign eukreign left a comment

Choose a reason for hiding this comment

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

Is test_hub_commands.py testing something that isn't tested by test_claim_commands.py? Do we need both?

See inline comments for more feedback.

lbry/wallet/network.py Outdated Show resolved Hide resolved
lbry/wallet/orchstr8/node.py Show resolved Hide resolved
lbry/wallet/orchstr8/node.py Outdated Show resolved Hide resolved
lbry/wallet/orchstr8/node.py Show resolved Hide resolved
lbry/wallet/orchstr8/node.py Outdated Show resolved Hide resolved
@lyoshenka lyoshenka marked this pull request as ready for review June 14, 2021 20:25
@jeffreypicard
Copy link
Collaborator Author

I fixed the issues mentioned and the build works on ubuntu, both the windows and macos build fail so I commented them out for now so that I could make sure the ubuntu build would actually run and pass.

@lyoshenka
Copy link
Member

does this connect the new hub code to our CI/CD process?

@jeffreypicard
Copy link
Collaborator Author

does this connect the new hub code to our CI/CD process?

I set the environment variable GO_HUB=true in the github pipeline yaml, so as long as that works the way I think it does, it should be using my go hub for the tests.

@jeffreypicard jeffreypicard force-pushed the golang_claim_search_tests branch 3 times, most recently from 619ab7a to ae21fc3 Compare June 17, 2021 17:45
@lyoshenka lyoshenka changed the title Golang claim search tests Use new GRPC hub API if it's available Jun 23, 2021
@lyoshenka
Copy link
Member

lyoshenka commented Jun 23, 2021

to add:

  • drop env var and always have it enabled
  • drop HUB_HOST - it should use the same host as the Python hub
  • drop HUB_PORT and hardcode it to 50051
  • when connecting to the Python hub, also try to connect to the GRPC port 50051. if it connection works, then use that for claim_search. if not, fall back to using the existing python claim_search
    • hook into existing reconnect event to do this
    • do this on the first claim_search for each connection. this avoids flooding the server

@lyoshenka
Copy link
Member

todo: review the kwargs changes

  • some of the changes remove features (like allowing claim_ids and not_claim_ids at the same time)
  • need to have consistency between the SDK api fields and the hub api fields

@jeffreypicard jeffreypicard force-pushed the golang_claim_search_tests branch 3 times, most recently from 78fc9a3 to ce87c37 Compare July 22, 2021 19:47
Have the basic starting /stopping / querying. Still don't have the hub
jsonrpc stuff working right and from the looks of it I need to clearify
some of the logic in the claim search function itself because it's not
returning the correct number of claims anyways.

get the integration working with grpcurl

Got tests working, still need to port the rest of them

ported all of the claim search tests

still a few failing due to not having inflation working, and there's something weird
with limit_claims_per_channel that needs to be fixed.
Fixing tests

relabel failing tests properly

run all the tests for the hub

cleanup HubNode
more protobuf changes (fix imports)
Cleanup prints and commented out code

remove print

don't do list claims

cleanup
@jeffreypicard jeffreypicard force-pushed the golang_claim_search_tests branch 2 times, most recently from 11f9817 to e21c9e8 Compare July 23, 2021 17:54
Comment on lines +2643 to +2647
except Exception as e:
if self.ledger.config['use_go_hub']:
log.warning("failed, trying again without hub")
self.ledger.config['use_go_hub'] = False
return await self.jsonrpc_claim_search(**kwargs_old)
Copy link
Member

Choose a reason for hiding this comment

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

@jeffreypicard two things

  1. we shouldn't modify the config like this. if another config is saved elsewhere, this setting will also be saved
  2. if this fallback is disabled, a bunch of tests fail. therefore we think this is hiding test failures by falling back to old working code.

more generally, if tests pass for all the new code, then errors here should be treated like production errors -- the sdk should report the error to the user.

@lyoshenka
Copy link
Member

closing because #3394 supersedes it

@lyoshenka lyoshenka closed this Sep 8, 2021
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.

4 participants