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

Incorrect batch unwrapping in JSON-RPC replay tool #7279

Merged
merged 8 commits into from
Aug 2, 2024

Conversation

emlautarom1
Copy link
Contributor

Changes

  • Fixes a bug where Kute would send a batch of requests individually but also as a batch, effectively sending all requests twice.
  • Fixes a bug where Kute would crash when using the -d | --dry mode due to incorrect null handling.
  • Optimize progress reporting when no batch unwrapping is requested.
  • Properly cache certain class properties.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

As mentioned in #6366 (comment) we need to introduce a proper test suite before adding any new features to Kute.

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

yield return new JsonRpc.SingleJsonRpc(JsonDocument.Parse(single.ToString()));
}
}
yield return new JsonRpc.BatchJsonRpc(jsonDoc);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A double enumeration happens here: if we unwrap batches we yield the batch elements, but we also yield the batch request at the end (most likely a missing else branch)

Copy link
Member

Choose a reason for hiding this comment

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

tools/Nethermind.Tools.Kute/Application.cs Outdated Show resolved Hide resolved
yield return new JsonRpc.SingleJsonRpc(JsonDocument.Parse(single.ToString()));
}
}
yield return new JsonRpc.BatchJsonRpc(jsonDoc);
Copy link
Member

Choose a reason for hiding this comment

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

@emlautarom1 emlautarom1 merged commit 3b36366 into master Aug 2, 2024
66 checks passed
@emlautarom1 emlautarom1 deleted the fix/kute-unwrap-batch branch August 2, 2024 17:39
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