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

Validate rollapps' constrains in CreateSequencer #44

Closed
liorzilp opened this issue Aug 2, 2022 · 0 comments · Fixed by #61
Closed

Validate rollapps' constrains in CreateSequencer #44

liorzilp opened this issue Aug 2, 2022 · 0 comments · Fixed by #61
Assignees
Labels
c:rollapp Rollapp module

Comments

@liorzilp
Copy link
Contributor

liorzilp commented Aug 2, 2022

Overview

When creating a sequencer it is attached to a specific rollapp instance (identified by rollappID), and this rollapp should be already existing. A rollapp also has a limit of maximum sequencers that could be attached and might have a list of permissioned sequencers. Both needed to be checked when creating a new sequencer.

Basic flow

On CreateSequencer

1. Retrieve rollapp object from the rollapp keeper
    - if not exists return ErrUnknownRollappId
2. If PermissionedAddresses list isn't empty:
    - check if the sequencer is in the list, if not return ErrSequencerNotPermissioned
3. Check that number of rollapps attached to this rollapp does not exceed MaxSequencers:
    - if not(SequencersByRollapp(rollappId)<rollapp.MaxSequencers) return ErrMaxSequencersLimit

Tests

 1. ErrUnknownRollappId
 2. ErrSequencerNotPermissioned
 3. ErrMaxSequencersLimit
@liorzilp liorzilp added the enhancement New feature or request label Aug 2, 2022
@liorzilp liorzilp self-assigned this Aug 2, 2022
@liorzilp liorzilp added c:rollapp Rollapp module and removed enhancement New feature or request labels Aug 2, 2022
@liorzilp liorzilp linked a pull request Aug 18, 2022 that will close this issue
@liorzilp liorzilp changed the title Validate rollappId constrains in CreateSequencer Validate rollapps' constrains in CreateSequencer Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:rollapp Rollapp module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant