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

Add interruptblock RPC #2982

Merged
merged 3 commits into from
Jul 29, 2024
Merged

Add interruptblock RPC #2982

merged 3 commits into from
Jul 29, 2024

Conversation

Jouzo
Copy link
Collaborator

@Jouzo Jouzo commented Jul 25, 2024

Summary

  • Introduces interruptblock RPC, which takes a block height as only param.
  • If a node is running without -interrupt-block startup flag, sets fInterrupt and fInterruptBlockHeight.
  • Can be run multiple times in a row and will update fInterruptBlockHeight to the latest height passed to interruptblock RPC.

This let's a user easily run a command against a target block height.
Example usage :

for height in `5000 10000 15000`
   defi-cli interruptblock height
   wait_for_block height
   ... Run any command at  required height.

Idea behind it is to ease diff log generation for full sync CI or Ocean A/B testing.
Current node behaviour requires multiple restart (as interrupt-block height can only be set via startup flag).
This also lets one interrupt an already running node.

prasannavl
prasannavl previously approved these changes Jul 26, 2024
@prasannavl
Copy link
Member

This region is un-synchronized. Would put this under the lock too.

    fInterruptBlockHeight = height;
    fInterrupt = true;

@prasannavl
Copy link
Member

Actually most of this needs the lock until the last activate step.

I'd actually just simplify it and take the lock as a whole than attempting to be granular here.

@prasannavl prasannavl merged commit 9181c3e into master Jul 29, 2024
20 of 26 checks passed
@prasannavl prasannavl deleted the feature/update-interrupt-block branch July 29, 2024 04:32
canonbrother pushed a commit that referenced this pull request Aug 21, 2024
* Add interruptblock RPC

* Rename setinterruptblock and add usage

* Set interrupt vars under lock
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.

2 participants