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

feat: consensus store acceptance and finalized states on contracts #787

Open
wants to merge 51 commits into
base: main
Choose a base branch
from

Conversation

kstroobants
Copy link
Contributor

@kstroobants kstroobants commented Jan 3, 2025

Fixes #783

What

  • Contract contains accepted and finalized state in a states dictionary.
  • The encoded state data member of the ContractSnapshot points to the accepted state. This is used in _SnapshotView reads and writes.
  • In the transaction accepted state, the contract accepted state is written to the database. The state is taken from the leader_receipt.
  • In the transaction finalized state, the contract finalized state is written to the database. The state is taken from the leader_receipt.
  • In case a transaction is executed on a contract that does not contain accepted and finalized state, then the old version of the state of an existing contract is updated.
  • Updated existing tests.

Why

  • To add more value to the user.

Testing done

  • Tested the new feature in the studio

Decisions made

The frontend get method show only the accepted contract state. I will create a new issue to show both accepted and finalized contact states.

Checks

  • I have tested this code
  • I have reviewed my own PR
  • I have created an issue for this PR
  • I have set a descriptive PR title compliant with conventional commits

Reviewing tips

  • Run the studio.
  • Check the code changes.

Depends on

This PR contains code from PR #768

User facing release notes

The finalized contact state is tracked.

kstroobants and others added 30 commits October 22, 2024 15:24
- Add N+2 validators, remove leader
- Use latest data of transaction when in pending state and not the old one from the crawler
- Write consensus data before setting status to have it updated in frontend when going to transaction info modal
- Do not deploy contract when transaction was in the undetermined state
kstroobants and others added 19 commits December 13, 2024 09:46
…king on finalized state gave a small delay in showing when appeal failed and finality window was exceeded
…sus-appeal-success-should-rollback-all-newer-transactions-to-pending
…d contract state in encoded_state for _SnapshotView reads and writes
…transactions-to-pending' into 783-consensus-store-acceptance-and-finalized-states-on-contracts
@kstroobants kstroobants requested a review from cristiam86 January 3, 2025 08:55
@kstroobants kstroobants self-assigned this Jan 3, 2025
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.

Project coverage is 18.16%. Comparing base (3ff73e5) to head (2336522).

Files with missing lines Patch % Lines
...ntend/src/components/Simulator/TransactionItem.vue 0.00% 23 Missing ⚠️
...tend/src/components/Simulator/TransactionsList.vue 0.00% 6 Missing ⚠️
frontend/src/views/Simulator/RunDebugView.vue 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #787      +/-   ##
==========================================
- Coverage   18.21%   18.16%   -0.06%     
==========================================
  Files         129      129              
  Lines       10076    10104      +28     
  Branches      302      302              
==========================================
  Hits         1835     1835              
- Misses       8156     8184      +28     
  Partials       85       85              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…transactions-to-pending' into 783-consensus-store-acceptance-and-finalized-states-on-contracts
Copy link

sonarqubecloud bot commented Jan 3, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
38.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consensus: store acceptance and finalized states on contracts
1 participant