Skip to content

Add more test cases for submitBlocksToDA in manager_test.go #1530

Closed

Description

@Manav-Aggarwal
This needs an update to testing. 

Test cases I can think of that we should understand how they execute. 
Assuming starting with Blocks a b c
1. happy case, all are submitted on first round
2. a and b are submitted first because including c triggers size limit. C is then submitted on second round.
3. C is too big on it's own, never submitted but a and b are
4. C has a marshal issue. A and b should still be submitted ( I think this case currently isn't possible with the code based on `SubmitBlocks`)
5. A is too big on its own 
6. A has a marshal issue

for cases 5 and 6, what should be the desired outcome? Do we never submit any blocks if the current next block is bad? Based on `SubmitBlocks` that appears to be the case.

_Originally posted by @MSevey in https://github.com/rollkit/rollkit/pull/1471#pullrequestreview-1832928038_

Note that test cases 1, 2, 3 here are added and test cases 4, 5, 6 need to be added.

Activity

  1. added
    T:testing
    and removed on Feb 7, 2024
  2. changed the title [-]Add more test cases for submitBlocksToDA[/-] [+]Add more test cases for submitBlocksToDA in manager_test[/+] on Feb 8, 2024
  3. changed the title [-]Add more test cases for submitBlocksToDA in manager_test[/-] [+]Add more test cases for submitBlocksToDA in manager_test.go[/+] on Feb 8, 2024
  4. arhamj commented on Feb 14, 2024

    @arhamj
    Contributor

    Can we catch serialisation errors much earlier at like the addPendingBlock stage. In the current implementation, this would come at the cost of serialising the same block an extra time but, we could avoid that by caching the result from the early serialisation step. This change could potentially help keep the pending block struct smaller.

    I'll proceed with writing the tests for cases 4, 5 and 6 for now.

  5. arhamj commented on Feb 14, 2024

    @arhamj
    Contributor

    Another option would be to separate the aggregation of blocks from the submission to DA and have the method which does the aggregation (applying size limits and serialization) in the block manager. Eviction on error could happen at this stage easily. (Probably log and evict for now?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    T:testing

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions