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

fix failing assert in connect RPC #5235

Merged
merged 5 commits into from
Jan 14, 2025
Merged

Conversation

mvadari
Copy link
Collaborator

@mvadari mvadari commented Jan 7, 2025

High Level Overview of Change

This PR fixes a failing assert scenario in the connect admin RPC.

Context of Change

When a node is in standalone mode and someone with admin access tries to submit this command, rippled fails an assert (and crashes in debug builds), regardless of what the other parameters are.

Example crashing command:

{
  "command": "connect"
}

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

API Impact

N/A, fixes something that results in a failed assert before

Before / After

Before, use of the connect RPC on a standalone node fails an assert in rippled. Now, it returns an error.

Test Plan

Tested locally.

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.0%. Comparing base (ccc0889) to head (708eec7).
Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #5235   +/-   ##
=======================================
  Coverage     78.0%   78.0%           
=======================================
  Files          789     789           
  Lines        66954   66953    -1     
  Branches      8108    8105    -3     
=======================================
+ Hits         52218   52224    +6     
+ Misses       14736   14729    -7     
Files with missing lines Coverage Δ
src/xrpld/rpc/handlers/Connect.cpp 17.6% <100.0%> (+17.6%) ⬆️

... and 4 files with indirect coverage changes

Impacted file tree graph

@ximinez ximinez added Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. and removed Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. labels Jan 7, 2025
@mvadari mvadari changed the title fix crash in connect RPC fix failing assert in connect RPC Jan 7, 2025
Copy link
Collaborator

@Bronek Bronek left a comment

Choose a reason for hiding this comment

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

nice !


BEAST_DEFINE_TESTSUITE(Connect, rpc, ripple);

} // namespace ripple
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: It's nice to add an empty line at the end to avoid upsetting github here. I usually recommend changing this setting in your favourite IDE (usually called "Insert Final Newline" or something like that).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

@mvadari
Copy link
Collaborator Author

mvadari commented Jan 14, 2025

@bthomee this is ready to merge whenever you get a chance

@Bronek Bronek added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Jan 14, 2025
@bthomee bthomee merged commit ff8b9aa into XRPLF:develop Jan 14, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants