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

403 process catchup request #722

Merged
merged 10 commits into from
Jan 29, 2025
Merged

403 process catchup request #722

merged 10 commits into from
Jan 29, 2025

Conversation

hMitov
Copy link
Collaborator

@hMitov hMitov commented Jan 28, 2025

Description

  • Implemented handling of catch up requests and introduced last finalized round reference to GrandpaSetState as per spec (It will be used in Play Grandpa Round and Process Catch-up Responses, too)
  • Added catch up threshold when sending catch up request as per spec
  • Extracted handling and sending of catch up requests to GrandpaSetState.java

Fixes #403 >


private List<Authority> authorities;
private BigInteger disabledAuthority;
private BigInteger setId;

private final BlockState blockState;
private final RoundCache roundCache;
private GrandpaRound lastFinalizedRound;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it be easier to store BigInteger lastFinalizedRoundNumber instead of GrandpaRound lastFinalizedRound and then call lastFinalizedRound.getRoundNumber()?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The lastFinalizedRound field should also be updated; I suggest setting it right after attemptToFinalizeAt() returns true or directly in the method itself.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We arranged that lastFinalizedRound will be taken from db

@hMitov hMitov marked this pull request as draft January 28, 2025 14:38
@hMitov hMitov marked this pull request as ready for review January 29, 2025 07:31
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think these are needed here. We can fully move the logic to the GrandpaSetState. The methods here do not bring any extra logic in the process.

@@ -10,7 +11,8 @@
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CatchUpMessage {
@Builder(toBuilder = true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do we need the toBuilder ?

@@ -9,6 +10,7 @@
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder(toBuilder = true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here as well.

Hristiyan Mitov added 3 commits January 29, 2025 13:14
# Conflicts:
#	src/main/java/com/limechain/network/protocol/grandpa/GrandpaService.java
…e methods from WarpSyncState.java to GrandpaSetState.java.
@hMitov hMitov merged commit eae0c4f into dev Jan 29, 2025
3 checks passed
@hMitov hMitov deleted the 403-process-catchup-request branch January 29, 2025 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Process Catchup request
4 participants