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

Introduce the Limit on Eagerness #878

Merged
merged 1 commit into from Jan 25, 2024
Merged

Introduce the Limit on Eagerness #878

merged 1 commit into from Jan 25, 2024

Conversation

tek
Copy link
Contributor

@tek tek commented Jan 12, 2024

!

@Niols Niols added the Genesis PRs related to Genesis testing and implementation label Jan 12, 2024
@facundominguez
Copy link
Contributor

Looks to me like prop_serveAdversarialBranches shouldn't be marked as a expected failure anymore after adding LoE. But please, let me know if this is not the case.

@Niols
Copy link
Contributor

Niols commented Jan 16, 2024

I don't think that is the case. First, for now, the LoE is disabled by default, so we should observe the normal behaviour. Still, it wouldn't be hard to enable it for that test in particular. Second, the property states both that the immutable tip should be honest and that it should not be too old. The LoE alone will not be able to provide that.

Now we could add a way to relax the property into only checking that the immutable tip is honest, and I think such a property should hold with the current LoE? However, in the current state of this PR, it doesn't.

@facundominguez
Copy link
Contributor

facundominguez commented Jan 16, 2024

Second, the property states both that the immutable tip should be honest and that it should not be too old. The LoE alone will not be able to prevent that.

How is that LoE could prevent the immutable tip to be at least within s+d+1 of the end of the honest chain? In this test, the adversarial peers serve adversarial branches but they do not withhold headers or blocks.

@amesgen
Copy link
Member

amesgen commented Jan 16, 2024

Second, the property states both that the immutable tip should be honest and that it should not be too old. The LoE alone will not be able to prevent that.

How is that LoE could prevent the immutable tip to be at least within s+d of the end of the honest chain?

Without the GDD logic and the LoP, it is trivial for an attacker to serve some historical alternative, which means that the intersection of the candidate fragments (beyond which the node can't select more than $k$ blocks) is stuck forever in the distant past (no liveness). The LoE just guarantees that the immutable tip is always on "the" honest chain (safety).

@facundominguez
Copy link
Contributor

Ah, I think my confusion is because I was expecting LoE to go together with the GDD governor.

@Niols
Copy link
Contributor

Niols commented Jan 16, 2024

The LoE just guarantees that the immutable tip is always on "the" honest chain (safety).

Still, we could provide a test case for that, maybe by providing a simpler property. Currently, there are cases with LoE enabled where the chain ends up on an alternative branch so it could be nice to catch that with a test.

@tek tek force-pushed the genesis/loe branch 3 times, most recently from 6cd9f47 to b4dea26 Compare January 22, 2024 17:35
, cdbLoELimit :: LoELimit
-- ^ How many blocks can be selected beyond the LoE. The non-degenerate
-- value for this is @k@, the security parameter.
, cdbUpdateLoE :: HKD f (UpdateLoE m blk)
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, do we actually want to include this for the milestone? It is convenient for testing as we don't need a separate monitoring thread, but it also shouldn't be too bad. Also, we have LoEUnlimited to disable the LoE directly for the purpose of mergeability into main.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So my plan would be to make this the ultimate interface for the GDDG, in a synchronous fashion.

The concern you raised was, iirc, that this would mean that peers wouldn't be disconnected promptly, but only "on demand", i.e. when we want to apply the LoE limit.

Another possible issue one might suspect is that this will not be triggered after refusing to add a block, though I assume that that's not the case – can you confirm that?

At first I thought you wanted this to only be exposed to tests and not prod, but I guess you assumed that this approach was just temporary.


Since the limit is used directly by ChainSel while UpdateLoE is a black box, I think it's necessary to have both as parameters.
However, the limit is basically a boolean and we use k for the value unconditionally, so we could theoretically merge them so that UpdateLoE has a constructor that indicates it's disabled, and ChainSel would match on the callback constructor to decide to apply the limit...probably bad style though.

Copy link
Member

Choose a reason for hiding this comment

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

Another possible issue one might suspect is that this will not be triggered after refusing to add a block, though I assume that that's not the case – can you confirm that?

By "refusing to add a block" you mean the event that we don't end up selecting the block? I think updateLoE is called sufficiently early (ie before checks whether it already is in the VolDB) that it should not be skipped even in that case.


Overall, the impact of updateLoEFrag is very minimal, and it is not a required part of the LoE deliverable, so we can leave it for now and decide this later when we implement the GDD.

@tek tek force-pushed the genesis/loe branch 6 times, most recently from 67bde7f to 2ff8e26 Compare January 23, 2024 14:26
@tek tek force-pushed the genesis/loe branch 2 times, most recently from 3313bd0 to e8f4195 Compare January 23, 2024 15:43
@tek tek changed the title [WIP] Introduce the Limit on Eagerness Introduce the Limit on Eagerness Jan 24, 2024
@tek tek force-pushed the genesis/loe branch 2 times, most recently from 1ad106f to bb47adc Compare January 24, 2024 15:20
@tek tek merged commit 58d614f into genesis/milestone8 Jan 25, 2024
9 checks passed
@tek tek deleted the genesis/loe branch January 25, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Genesis PRs related to Genesis testing and implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants