Skip to content

Conversation

lasarojc
Copy link
Contributor

@lasarojc lasarojc commented Aug 4, 2023

Only wait if a new timestamp is being generated. If the one in the valid value is being used, just speed things up

This change is made on master because the spec in main is not updated, which is another issue.


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

Only wait if a new timestamp is being generated.
This change is made on master because the spec in main is not updated
@lasarojc lasarojc marked this pull request as ready for review August 4, 2023 11:08
@sergio-mena
Copy link
Contributor

I think there is another possible improvement in [PBTS-ALG-UPON-PROP.1].

The timely check is added to the upon clause, but, in the case where we have lockedValue_p = v, we should not call timely for the same reason we don't call timely in lines 28-33 of the arXiv algorithm.

@lasarojc
Copy link
Contributor Author

lasarojc commented Aug 4, 2023

I think there is another possible improvement in [PBTS-ALG-UPON-PROP.1].

The timely check is added to the upon clause, but, in the case where we have lockedValue_p = v, we should not call timely for the same reason we don't call timely in lines 28-33 of the arXiv algorithm.

Potential fix.

upon ⟨PROPOSAL, h_p, round_p, v, −1⟩ from proposer(h_p, round_p) while step_p = propose do {
  if (lockedValue_p = v) || (lockedRound_p = −1 && valid(v) && timely(v)) {
    broadcast ⟨PREVOTE, h_p, round_p, id(v)⟩ 

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale For use by stalebot label Aug 15, 2023
@lasarojc lasarojc self-assigned this Aug 15, 2023
@lasarojc lasarojc added wip Work in progress and removed stale For use by stalebot labels Aug 15, 2023
@cason
Copy link

cason commented Aug 17, 2023

Hey, getting here late. I don't see any practical effect from this change. The point of that line is to ensure that the current time is higher than the timestamp of the previous block. This (being too fast) can happen in any scenario, but it is much more likely to happen in round 0, when we don't have a valid block. We can only have a valid block from round 1, when it is pretty unlikely that we have to wait for the local time to be higher than last block's time.

In summary, this wait is just a safety anchor to slow down fast validators. It should not really impact the practical operation of any node, and if it does it will be at round 0, when there is no valid block. I would keep as it was, mostly because I can't see any benefits from this change, and it is also more clear (and the goal of the spec is this) to just do this check in every round.

@lasarojc
Copy link
Contributor Author

Some more context, which should have been in the description.
We have been discussing how to implement PBTS at the app level. In this case, delaying the proposal is made inside prepareProposal. However, if there is a validBlock, prepareProposal is not called.
By fixing the spec in the proposed way, it captures this behavior as valid.

A similar argument serves for the @sergio-mena 's proposal. If the block is valid it will not be passed to processProposal, where its "timely"ness would be evaluated.

@lasarojc lasarojc removed the wip Work in progress label Oct 31, 2023
@lasarojc lasarojc marked this pull request as draft October 31, 2023 15:10
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale For use by stalebot label Nov 11, 2023
@github-actions github-actions bot closed this Nov 15, 2023
@lasarojc
Copy link
Contributor Author

This discussion should be reopened when we port PBTS to main.

@lasarojc
Copy link
Contributor Author

This discussion was taken into consideration when merging the specs from master to main.

@lasarojc lasarojc deleted the lasarojc-patch-3 branch January 30, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale For use by stalebot
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants