Skip to content

refactor: remove abci commit call - #461

Merged
shotonoff merged 5 commits into
sbe-e2e-fixesfrom
remove-commit-operation
Sep 21, 2022
Merged

shotonoff merged 5 commits into
sbe-e2e-fixesfrom
remove-commit-operation

Conversation

@shotonoff

@shotonoff shotonoff commented Sep 16, 2022 •

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

same-block execution approach allows us to deprecate ABCI commit call, as this is now already done by the finalizeBlock call.

What was done?

ABCI method commit was removed

How Has This Been Tested?

Tests

Breaking Changes

N/A

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

Comment thread abci/example/kvstore/kvstore.go Resolved
FinalizeBlock: finalizeBlockResponse,
FinalizeBlock: fbResp,
}
if err := blockExec.store.SaveABCIResponses(block.Height, abciResponses); err != nil {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This means the app can be ahead of tenderdash if sth goes wrong (app already finalized the block, but tenderdash crashes). But in #460 we have the following comment:

		// the app should never be ahead of the store (but this is under app's control)

Please double-check this and ensure we support this case in replay

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this case is already supported,
there is a unit-test here

@lklimek lklimek Sep 20, 2022 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If I'm not mistaken, the order in which we save data is as follows:

  1. Save block to store
  2. FinalizeBlock
  3. Save state

So, the cases to check are:

  1. Block Store is at height H, app H-1, state at H-1
  2. Block Store is at height H, app H, and state at H-1
  3. Block Store is at height H, app H, and state at H

The test case you linked points to:
// state-height is one ahead of store-height and app-height is equal to store-height
In my terms above - this is: block store at H-1, App at H-1, state at H.

But block store will never be behind state, as it is saved first (except for crashes).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

all the test cases you noted are supported in a test

Comment thread internal/state/execution.go Resolved
@shotonoff
shotonoff requested a review from lklimek September 19, 2022 13:49

@shotonoff shotonoff left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

made the changes by PR feedback

@lklimek lklimek mentioned this pull request Sep 20, 2022
1 of 5 tasks
@shotonoff
shotonoff merged commit e40a709 into sbe-e2e-fixes Sep 21, 2022
@shotonoff
shotonoff deleted the remove-commit-operation branch September 21, 2022 08:38
lklimek added a commit that referenced this pull request Oct 4, 2022
…execution (#457)

* fix(abci/types): panic in ValidatorSetUpdate.MarshalJSON()

* refactor(kvstore): separate state from application

* feat(kvstore): allow setting of persistence store and interval

* feat(kvstore): app state can be marshaled to JSON (with DB content)

* refactor(kvstore): merge kvstore with e2e app

* chore: rewrite kvstore and e2e - "single" e2e test pass

* fix(kvstore,e2e): kvstore state import breaks state

* refactor(e2e): Move vote extension logic back to e2e app

As we add a tx to each block as part of vote extension logic,
we break other tests.

* refactor(kvstore): self-review

* test(consensus): fix invalid vote extension test

* chore(e2e): re-add e2e app Rollback() to fix test

* chore(kvstore): mv helpers.go helpers_test.go

* test(kvstore): add snapshots test

* refactor: remove abci commit call (#461)

* refactor: remove commit ABCI call

* fix(statesync): verify light block should use current height

* refactor(kvstore): remove persistentkvstore app, rename New* funcs and return error, refactor state store

* fix(kvstore): bytes.Buffer should be a pointer

* chore: apply code review feedback

* test(consensus): use t.Cleanup to rm test dir and cleanup state

* chore(abci/types): fix val update json marshal returns nil on nil input

* chore(kvstore): apply code review feedback

* chore(consensus): fix build issues after merge

* fix(state): correctly save validators at genesis

* test(consensus): fix TestBlockReplayerReplay

* Revert "fix(state): correctly save validators at genesis"

This reverts commit a8cd027.

* fix(consensus): validators from InitChain should replace genesis validators

* fix(consensus): quorum type removed when processing initChain validators

* test(rpc/client): minor test improvements

* fix(state): last height validator changed handled incorrectly in initChain

* chore(state): remove unused GetProcessProposalResponse

* fix: some fixes after refactoring kvstore (#463)

* fix: TestKVStoreKV, TestClientServer in kvstore_test.go
* chore: remove Application.chainLockUpdate as unused functionality
* chore: moved back chain-lock update to kvstore
* chore: fix lint issues
* fix: abci-client tests

* fix: sbe unit tests (#464)

* fix: replace state.LastCoreChainLockedBlockHeight with InitialCoreHeight
* refactor: leave one save-validators-info

* chore: minor code improvements based on feedback

Co-authored-by: Dmitrii Golubev <[email protected]>
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.

2 participants