Skip to content

feat(drive-abci)!: include invalid state transitions into block - #1657

Merged
shumkov merged 10 commits into
v1.0-devfrom
feat/include-paid-errors
Jan 5, 2024
Merged

feat(drive-abci)!: include invalid state transitions into block#1657
shumkov merged 10 commits into
v1.0-devfrom
feat/include-paid-errors

Conversation

@shumkov

@shumkov shumkov commented Jan 4, 2024

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Client is getting notifications about state transition execution results from DAPI that gets, in turn, them from Tenderdash. Since we removed unnecessary validation from check tx and re-check with #1647 and currently we don't include invalid STs into blocks, client is not getting state transition execution results in some specific cases. To solve this we need to include state transitions what user can pay for with identity balance.
This PR should solve the notification problem. The balance reduction for included invalid state transitions will be a matter of upcoming PR.

What was done?

  • Introduced high-level state transition processing result that contains StateTransitionExecutionResult instead of EventExecutionResult. Added variants:
    • DriveAbciError for state transition processing errors and ignore such state transitions for the block
    • PaidConsensusError to include invalid state transitions to a block and cover processing fees in the future
  • Handle deserialization errors to do not fail the block but return consensus errors
  • Validated set of state transitions on process proposal to make sure that proposer didn't include errored or not covered with fees state transitions
  • Added StateTransitionConsenusError to HandlerError
  • Added more logging

How Has This Been Tested?

Together with #1647 to make sure it solves the problem #1658

Breaking Changes

  • Block processing logic is changed. That makes previous chain data invalid.

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 added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

# Conflicts:
#	packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/execute_event/v0/mod.rs
#	packages/rs-drive-abci/src/execution/platform_events/state_transition_processing/validate_fees_of_event/v0/mod.rs
Comment thread packages/rs-drive-abci/src/abci/handler/mod.rs
Comment thread packages/rs-drive-abci/src/abci/handler/mod.rs Outdated
Comment thread packages/rs-drive-abci/src/abci/handler/mod.rs
Comment thread packages/rs-drive-abci/src/execution/engine/run_block_proposal/v0/mod.rs Outdated
@shumkov shumkov changed the title feat!: deduct fees for invalid state transitions feat!: include invalid state transitions into block Jan 5, 2024
@shumkov
shumkov marked this pull request as ready for review January 5, 2024 09:25
@shumkov shumkov changed the title feat!: include invalid state transitions into block feat!(drive-abci): include invalid state transitions into block Jan 5, 2024
@shumkov shumkov changed the title feat!(drive-abci): include invalid state transitions into block feat!(drive): include invalid state transitions into block Jan 5, 2024
@shumkov shumkov changed the title feat!(drive): include invalid state transitions into block feat(drive)!: include invalid state transitions into block Jan 5, 2024
@shumkov shumkov changed the title feat(drive)!: include invalid state transitions into block feat(drive-abci)!: include invalid state transitions into block Jan 5, 2024
@shumkov
shumkov merged commit ea27d6a into v1.0-dev Jan 5, 2024
@shumkov
shumkov deleted the feat/include-paid-errors branch January 5, 2024 16:15
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