Skip to content

feat(abci): Add round to Prepare/ProcessProposal, FinalizeBlock#498

Merged
lklimek merged 11 commits intov0.10-devfrom
abci-round
Nov 8, 2022
Merged

feat(abci): Add round to Prepare/ProcessProposal, FinalizeBlock#498
lklimek merged 11 commits intov0.10-devfrom
abci-round

Conversation

@lklimek
Copy link
Collaborator

@lklimek lklimek commented Oct 26, 2022

Issue being fixed or feature implemented

For better transaction processing in same-block execution mode, ABCI clients need round number in PrepareProposal, ProcessProposal, and FinalizeBlock.

What was done?

  1. Added missing field
  2. Updated tests
  3. Updated kvstore app

How Has This Been Tested?

Breaking Changes

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@lklimek lklimek marked this pull request as draft October 27, 2022 13:02
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is round important for replay blocks?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When we replay blocks on ABCI app, we should provide the same round as previously to make it deterministic. If we just send 0, it will be non-deterministic (block can be accepted at round 123456, then TD is restarted and the block will be replayed with round 0).

For current functionality it might not be important, but is important for API consistency.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mean deterministic and consistent on the ABCI app level?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, ABCI app shall get the same round every time it gets a message.

@lklimek lklimek marked this pull request as ready for review October 28, 2022 09:24
Copy link
Collaborator

@shotonoff shotonoff left a comment

Choose a reason for hiding this comment

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

🚀 LGTM
pease have a look at the comments

return nil
}

func roundKey(appHash tmbytes.HexBytes, height int64, round int32) string {
Copy link
Collaborator

Choose a reason for hiding this comment

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

do I understand correctly, that app-hash might be the same between rounds at the same height?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, but apphash it is redundant here (as an additional check), in theory height+round should be enough

Status: abci.ResponseProcessProposal_ACCEPT,
}, nil)
uncommittedState, err := blockExec.ProcessProposal(ctx, block1, state, true)
uncommittedState, err := blockExec.ProcessProposal(ctx, block1, 12, state, true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is 12 magic number ? :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, just a random height, changed to constant to make it more obvious

// Merkle root of the next validator set.
bytes next_validators_hash = 7;
// Round number for the block.
int32 round = 8;
Copy link
Collaborator

Choose a reason for hiding this comment

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

WDYT usage 1XX position for round, the same as for other dash related fields?

@lklimek lklimek requested a review from shotonoff November 8, 2022 10:12
@lklimek lklimek merged commit bac4ac1 into v0.10-dev Nov 8, 2022
@lklimek lklimek deleted the abci-round branch November 8, 2022 13:28
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.

3 participants