-
Notifications
You must be signed in to change notification settings - Fork 1
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: not inclusive start block #68
base: main
Are you sure you want to change the base?
Conversation
@invocamanman I find this very confusing. EDIT - if this is how other count proof ranges, then ok. |
2a3791b
to
3d81cb9
Compare
3d81cb9
to
e7ea0f1
Compare
e7ea0f1
to
93ac82c
Compare
93ac82c
to
650adc6
Compare
f19bb03
to
0720b14
Compare
0720b14
to
55a6e30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering why was this convention introduced, as it's quite different from the usual [start, end)
convention which may cause unintended off-by-one errors.
How does it integrate with the |
In regards to the aggsender, we are using approach 1 (the old approach). One question I have about this:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
yeah I believe no witness for the |
IMO it makes more sense to be inclusive, it's more intuitive... If I request a proof from block 10 to 20, I expect a proof from block 10 to 20, not from 11 to 20 😅 |
For this subject, after discussing with different members, it appears that we've not an agreement on this. Question: @vcastellm, I remember when discussing this with you that the
To do some pros and cons, for both solution: InclusiveAs @arnaubennassar said, when reading the API, it is expected that the caller receive a proof from Pros
Cons
ExclusionPros
Cons
I think both options have good and valid points, something that can be a third option is to refactor how we think the API. The change is how we define the Current// The request message for generating aggchain proof.
message GenerateAggchainProofRequest {
// The start block for which the aggchain proof is requested.
uint64 start_block = 1;
// The max end block for which the aggchain proof is requested.
uint64 max_end_block = 2;
...
} Updated// The request message for generating aggchain proof.
message GenerateAggchainProofRequest {
// The latest proven block
uint64 lastest_proven_block = 1;
// The max end block for which the aggchain proof is requested.
uint64 max_end_block = 2;
...
} What do you think? cc @invocamanman @arnaubennassar @vcastellm @agglayer/agglayer-developers |
Description
We use the
start_block
as the first block that's proved. That would mean that the block proven follows the[start_block, finalBlock]
convention.Usually in rollups is used the
(start_block, finalBlock]
convention, so, start block not inclusive.This is useful usually to check that the last
finalBlock
matches thestart_block
of the next proving block.As an example of our current and new approach given a scenario with 2 range proofs. The first proof proves the block 1 and 2 and the second one proves the block 3:
Current Approach
start_block
end_block
New Convention
start_block
end_block
Additions and Changes
I fix a condition and add comments regarding this change
Mainly i think this will be relevant in the upcoming PRs.
For example now instead of doing this kinda minus one scenarios we will be able to use
start_block
right awayIt's similar to the common convention with the rollups and personally i find it more intuitive ( maybe bc i work on a rollup for a while :P)
PR Checklist: