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

Implement pagination by tx hash for requesting of transaction history #2940

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

paberr
Copy link
Member

@paberr paberr commented Sep 27, 2024

What's in this pull request?

This PR adds a start_at parameter to various functions used to request the transaction history.
This efficiently adds pagination of results from a known transaction hash (which will not be included in subsequent queries).

@sisou This changes the interface slightly, adding a new parameter. It would be good to have your input on this.

This fixes #2697, #2733, #2247.

Pull request checklist

  • All tests pass. The project builds and runs.
  • I have resolved any merge conflicts.
  • I have resolved all clippy and rustfmt warnings.

Copy link
Member

@nibhar nibhar left a comment

Choose a reason for hiding this comment

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

Just minor comments.

consensus/src/consensus/consensus_proxy.rs Show resolved Hide resolved
web-client/src/client/lib.rs Show resolved Hide resolved
web-client/src/client/lib.rs Show resolved Hide resolved
@paberr
Copy link
Member Author

paberr commented Oct 4, 2024

Feedback from @sisou: for backwards-compatibility, it would be better to have new functions for the pagination and keep the old ones.

@Eligioo
Copy link
Member

Eligioo commented Oct 7, 2024

Feedback from @sisou: for backwards-compatibility, it would be better to have new functions for the pagination and keep the old ones.

It feels a bit ambiguous to have a one method that supports and one which doesn't support the start_at. Also since we don't have a RC yet we could have a breaking RPC interface imo.

blockchain/src/history/interface.rs Show resolved Hide resolved
blockchain/src/history/history_store_index.rs Show resolved Hide resolved
rpc-interface/src/blockchain.rs Show resolved Hide resolved
rpc-interface/src/blockchain.rs Show resolved Hide resolved
@paberr
Copy link
Member Author

paberr commented Oct 12, 2024

Feedback from @sisou: for backwards-compatibility, it would be better to have new functions for the pagination and keep the old ones.

It feels a bit ambiguous to have a one method that supports and one which doesn't support the start_at. Also since we don't have a RC yet we could have a breaking RPC interface imo.

This only applies to the web-client and his reasoning is that you always have to provide null for options if you don't want to pass them. But then, there are two Option already. Not sure if a third really makes a difference.

@sisou
Copy link
Member

sisou commented Oct 14, 2024

The problem with having to send null applies only to the RPC methods. Javascript (web-client) works correctly with omitted properties (undefined).

@jsdanielh
Copy link
Member

Rebasing branch to merge it

@jsdanielh jsdanielh merged commit a63bc0d into albatross Oct 14, 2024
7 checks passed
@jsdanielh jsdanielh deleted the pb/tx-retrieval branch October 14, 2024 19:32
@jsdanielh jsdanielh added this to the Nimiq PoS Mainnet milestone Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants