[go: up one dir, main page]

RPC/Delegate: baking_rights computation takes advantage of caching of the table of slot holder

Context & Manually testing the MR

Without this patch, if you call using a mainnet context the RPC /chains/main/blocks/<a level of cycle X>/helpers/baking_rights?cycle=<X+1>&max_round=2 (actually any Y != X, not necessarily X+1) your node will compute more than 10 minutes before replying. This is because you'll compute 8192 times the "table of slot holder" for cycle X+1 (Y) which is not in cache...

This MR removes in proto_alpha the function that computes baking rights without returning the updated cache and updates in all live protocols the RPC baking_rights to take advantage of caching.

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR

Merge request reports

Loading