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

[R4R] add block proccess backoff time when validator is not in turn and received in turn block #426

Merged
merged 6 commits into from
Oct 13, 2021

Conversation

yutianwu
Copy link
Contributor

@yutianwu yutianwu commented Sep 23, 2021

Description

When the network is congested, the possibility of fork blocks is higher. Sometimes it's because validators not in turn propagate the same height block. The validators not in turn have a backoff time but it may can not process the received in turn block in this duration and propagate the same height block. So we add a mechanism to check if the validator received in turn block and increase the backoff time for the process of the in turn block to finish.

Rationale

To reduce the possibility of fork blocks.

Example

Changes

Notable changes:

  • Increase backoff time when validators not in turn processing the in turn block

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • manual transaction test passed

Already reviewed by

...

Related issues

... reference related issue #'s here ...

@yutianwu yutianwu force-pushed the improve_backoff branch 2 times, most recently from 58a16b9 to 157c22c Compare September 23, 2021 07:22
@yutianwu yutianwu changed the title [WIP] add block proccess backoff time when validator is not in turn [WIP] add block proccess backoff time when validator is not in turn and received in turn block Sep 23, 2021
core/blockchain.go Outdated Show resolved Hide resolved
@unclezoro unclezoro changed the base branch from master to develop September 27, 2021 02:06
@unclezoro unclezoro changed the title [WIP] add block proccess backoff time when validator is not in turn and received in turn block [R4R] add block proccess backoff time when validator is not in turn and received in turn block Sep 27, 2021
select {
case <-stop:
log.Info("Received block process finished, abort block seal")
return
Copy link
Contributor

Choose a reason for hiding this comment

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

I think add a blank line between each case will be better for code readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

most of the codebase doesn't add a blank line, that should be fine

@yutianwu yutianwu merged commit c737f66 into develop Oct 13, 2021
This was referenced Oct 19, 2021
@yutianwu yutianwu deleted the improve_backoff branch November 16, 2021 04:09
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.

4 participants