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

feat: limit cert by estimated size #217

Merged
merged 11 commits into from
Dec 3, 2024

Conversation

joanestebanr
Copy link
Contributor

@joanestebanr joanestebanr commented Dec 3, 2024

Description

This set a limit on certificate size that can be set on config file (the size of certificate it's an estimation)
There are a special situation that is going to send a certificate bigger than maximium:

  • [ initial_block, end_block ] -> size exceed
  • [ initial_block, (end_block -1) ] -> no bridges, so we have to send previous one even that exceed the maximum size

Config

MaxCertSize: max size in bytes of certificate. Default 8Mb. Currently the maximum on Agglayer is 10Mb

[AggSender]
MaxCertSize = 8388608

@joanestebanr joanestebanr marked this pull request as ready for review December 3, 2024 10:42
aggsender/aggsender.go Outdated Show resolved Hide resolved
aggsender/aggsender.go Outdated Show resolved Hide resolved
aggsender/aggsender.go Outdated Show resolved Hide resolved
Copy link
Contributor

@vcastellm vcastellm left a comment

Choose a reason for hiding this comment

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

LGTM but I understand that the size is not 100% accurate but based on estimations right?

Another issue I see is that the user can overflow the agglayer, should we limit the cert size to AggLayer max limit?

aggsender/types/certificate_params.go Outdated Show resolved Hide resolved
aggsender/types/certificate_params.go Outdated Show resolved Hide resolved
aggsender/aggsender_test.go Outdated Show resolved Hide resolved
aggsender/aggsender_test.go Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Dec 3, 2024

@joanestebanr joanestebanr merged commit 158cfd2 into release/v0.5.0 Dec 3, 2024
12 checks passed
@joanestebanr joanestebanr deleted the feature/cdk595-aggsender_limit_cert_size branch December 3, 2024 14:56
joanestebanr added a commit that referenced this pull request Dec 4, 2024
This set a limit on certificate size that can be set on config file (the size of certificate it's an estimation)
There are a special situation that is going to send a certificate bigger than maximium:
- [ initial_block, end_block ] -> size exceed
- [ initial_block, (end_block -1) ] -> no bridges, so we have to send previous one even that exceed the maximum size

MaxCertSize: max size in bytes of certificate. Default 8Mb. Currently the maximum on Agglayer is 10Mb
```
[AggSender]
MaxCertSize = 8388608
```
joanestebanr added a commit that referenced this pull request Dec 4, 2024
* feat: limit cert by estimated size (#217)

This set a limit on certificate size that can be set on config file (the size of certificate it's an estimation)
There are a special situation that is going to send a certificate bigger than maximium:
- [ initial_block, end_block ] -> size exceed
- [ initial_block, (end_block -1) ] -> no bridges, so we have to send previous one even that exceed the maximum size

MaxCertSize: max size in bytes of certificate. Default 8Mb. Currently the maximum on Agglayer is 10Mb
```
[AggSender]
MaxCertSize = 8388608
```

* feat: return an error in case agglayer returns certificate with height lower than in local storage (#209)


---------

Co-authored-by: Stefan Negovanović <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants