lisk-sdk icon indicating copy to clipboard operation
lisk-sdk copied to clipboard

Implement syncHandler for handling `getLegacyBlocksFromId ` RPC

Open ishantiw opened this issue 2 years ago • 0 comments

Description

Implement syncHandler method which is being called after receiving getLegacyBlocksFromId RPC request

  1. Call addRateLimit function on network
  2. Unwrap and decode data field coming from the request 2.1 If the above fails then return without processing the request. 2.2 If the "id" doesn't exist then respond with empty list 2.3 If the request data is malformed then ban the peer with 100 penalty score
  3. Check the requested height and get the next 100 blocks
  4. Wrap the encoded list of blocks within the data and respond

Acceptance Criteria

  • Should have all the unit tests to test syncHandler implementation

ishantiw avatar Sep 06 '22 10:09 ishantiw