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

implements get_next_block_best_parents + get_largest_stakers methods #3449

Conversation

modship
Copy link
Member

@modship modship commented Jan 20, 2023

  • document all added functions
  • try in sandbox /simulation/labnet
  • unit tests on the added/changed features
    • make tests compile
    • make tests pass
  • add logs allowing easy debugging in case the changes caused problems
  • if the API has changed, update the API specification

closes #3419 #3485

@modship
Copy link
Member Author

modship commented Jan 20, 2023

@aoudiamoncef

I should update openrpc.json file manually ?

@aoudiamoncef
Copy link
Contributor

@aoudiamoncef

I should update openrpc.json file manually ?

Yes

@aoudiamoncef aoudiamoncef self-requested a review January 27, 2023 13:39
massa-api/src/api.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@aoudiamoncef aoudiamoncef left a comment

Choose a reason for hiding this comment

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

@modship,

  • May be we should rename this method to get_next_block_best_parents or next_block_best_parents ?

  • I was thinking about flatten or not ApiRequest struct, in the future, we could add sorting, filter and args for example. IMHO the actual form is good.

@modship modship requested a review from aoudiamoncef January 30, 2023 11:01
Copy link
Contributor

@aoudiamoncef aoudiamoncef left a comment

Choose a reason for hiding this comment

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

Great work @modship 👍🏻

@modship modship requested a review from aoudiamoncef January 30, 2023 13:22
massa-node/base_config/openrpc.json Outdated Show resolved Hide resolved
@aoudiamoncef aoudiamoncef changed the title implements get_best_parents method implements get_next_block_best_parents method Jan 30, 2023
@aoudiamoncef aoudiamoncef force-pushed the implement_get_best_parents_apiv2_#3419 branch from e423a3b to 752702b Compare January 31, 2023 17:02
@aoudiamoncef aoudiamoncef changed the title implements get_next_block_best_parents method implements get_next_block_best_parents + get_largest_stakers methods Jan 31, 2023
@aoudiamoncef
Copy link
Contributor

aoudiamoncef commented Jan 31, 2023

Hi @modship @Leo-Besancon
I continued the work on this PR by removing pagination from get_next_block_best_parents and reusing the code in get_largest_stakers

In this PR, we are adding an evolutive way to do request parameters and pagination. We'll try to add this to testnet19 and collect feedbacks from our consumers. take a look at #3485

I'll update the Postman collection with this new experimental methods.

Copy link
Collaborator

@Leo-Besancon Leo-Besancon left a comment

Choose a reason for hiding this comment

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

This APIv2 will be great 👌

@aoudiamoncef
Copy link
Contributor

@Leo-Besancon,

I added a default offset limit on get_largest_stakers to return the first 50 stakers.
.
IMHO, this is fine for an experimental feature, we'll collect the feedbacks in testnet19 and improve things.

Leo-Besancon
Leo-Besancon previously approved these changes Feb 1, 2023
Copy link
Collaborator

@Leo-Besancon Leo-Besancon left a comment

Choose a reason for hiding this comment

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

Looks fine to me 👍

@aoudiamoncef aoudiamoncef self-requested a review February 1, 2023 14:54
aoudiamoncef
aoudiamoncef previously approved these changes Feb 1, 2023
@AurelienFT AurelienFT changed the base branch from testnet_19 to testnet_20 February 1, 2023 15:03
@AurelienFT AurelienFT dismissed stale reviews from aoudiamoncef and Leo-Besancon February 1, 2023 15:03

The base branch was changed.

@AurelienFT
Copy link
Contributor

@modship can you rebase this on the latest version of testnet_20 ? the CI has been fixed and you will be able to merge it.

@aoudiamoncef aoudiamoncef merged commit 406962d into massalabs:testnet_20 Feb 3, 2023
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.

4 participants