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

Retrieve SwapExecutions from nonverifiable storage in RPC #4622

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

zbuc
Copy link
Member

@zbuc zbuc commented Jun 14, 2024

Describe your changes

The SwapExecutions RPC was retrieving results from the JMT, but historic SwapExecutions are actually stored in nonverifiable storage.

Issue ticket number and link

Closes #4618

Checklist before requesting a review

  • If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason:

    Only changes RPC response

@@ -309,9 +309,9 @@ impl QueryService for Server {
let trading_pair: Option<DirectedTradingPair> =
trading_pair.map(|trading_pair| trading_pair.try_into().expect("invalid trading pair"));

let s = state.prefix(state_key::swap_executions());
let s = state.nonverifiable_prefix(&state_key::swap_executions().as_bytes());
Copy link
Member

Choose a reason for hiding this comment

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

I think we could use a range query too and avoid iterating over every key.

Copy link
Member

@erwanor erwanor left a comment

Choose a reason for hiding this comment

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

LGTM

@erwanor erwanor added A-node Area: System design and implementation for node software A-dex Area: Relates to the dex labels Jun 17, 2024
@erwanor erwanor added this to the Sprint 8 milestone Jun 17, 2024
@erwanor erwanor merged commit 756b67a into main Jun 17, 2024
13 checks passed
@erwanor erwanor deleted the 4618_swapexecutions_rpc_fix branch June 17, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dex Area: Relates to the dex A-node Area: System design and implementation for node software
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Dex SwapExecutions endpoint returning no data
2 participants