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

Send transactions in lightwalletd integration tests #3512

Closed
Tracked by #3134
teor2345 opened this issue Feb 10, 2022 · 3 comments · Fixed by #4068
Closed
Tracked by #3134

Send transactions in lightwalletd integration tests #3512

teor2345 opened this issue Feb 10, 2022 · 3 comments · Fixed by #4068
Assignees
Labels
A-devops Area: Pipelines, CI/CD and Dockerfiles A-network Area: Network protocol updates or fixes A-rust Area: Updates to Rust code C-testing Category: These are tests lightwalletd any work associated with lightwalletd

Comments

@teor2345
Copy link
Contributor

Motivation

The sendrawtransaction RPC method in lightwalletd needs to be able to create and send transactions on the network.

We might need to do a full sync to make these tests work.
We might need a developer wallet to make these tests work on mainnet.

Tasks

  • Add a test harness that syncs to the tip from cached state
  • Create a new transaction
  • Add a lightwalletd integration test for sendrawtransaction
@teor2345 teor2345 added A-rust Area: Updates to Rust code A-devops Area: Pipelines, CI/CD and Dockerfiles S-needs-triage Status: A bug report needs triage A-network Area: Network protocol updates or fixes C-testing Category: These are tests labels Feb 10, 2022
@teor2345
Copy link
Contributor Author

teor2345 commented Feb 10, 2022

@teor2345 teor2345 changed the title Add support for sending transactions via lightwalletd Send transactions in lightwalletd integration tests Feb 10, 2022
@ftm1000 ftm1000 removed the S-needs-triage Status: A bug report needs triage label Feb 14, 2022
@ftm1000 ftm1000 assigned oxarbitrage and unassigned oxarbitrage Feb 16, 2022
@ftm1000 ftm1000 added the lightwalletd any work associated with lightwalletd label Mar 16, 2022
@jvff
Copy link
Contributor

jvff commented Mar 18, 2022

An idea on how to test this without having to set up an account and use real funds (which would limit CI execution and potentially make it more complicated due to the need to protect keys):

  1. Spawn a zebrad instance
  2. Pick a (recent?) block height
  3. Get some transactions from blocks after that block height
  4. Stop the zebrad instance
  5. Spawn a new zebrad instance for lightwalletd to interface with
  6. Synthetically limit this new zebrad instance to the chosen block height
  7. Try to send the transactions that were obtained from future blocks

I guess the hardest part would be step 6. One idea might be to have an optionally compiled in service layer that intercepts state service calls and discards responses that would indicate data from heigher block heights.

Any opinions on this idea?

@teor2345
Copy link
Contributor Author

teor2345 commented Mar 21, 2022

I guess the hardest part would be step 6. One idea might be to have an optionally compiled in service layer that intercepts state service calls and discards responses that would indicate data from heigher block heights.

Configure the zebrad instance with no seed peers, then it can't possibly get any new blocks.

(We already have a debug_stop_at_height config for step 4, and a restart_stop_at_height acceptance test for steps 1, 4 & 6.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-devops Area: Pipelines, CI/CD and Dockerfiles A-network Area: Network protocol updates or fixes A-rust Area: Updates to Rust code C-testing Category: These are tests lightwalletd any work associated with lightwalletd
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants