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 frontend get method should show accepted and finalized contract state #801

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

Conversation

kstroobants
Copy link
Contributor

Fixes #788

What

  • Added for loop in frontend to do two eth_calls. When read method button is pressed it will output the accepted and the finalized contact state.
  • Parsed the eth_call arguments to get the state status
  • Added the state status as a data member of the _SnapshotView class and use it in the storage_read and storage_write methods.
  • Removed the encoded_state from the contractSnapshot class as it is redundant.

Why

  • To add more value to the user

Testing done

  • Tested the new feature in the studio

Decisions made

Read method button performs two eth_calls (one for accepted and one for finalized). Another option was two buttons.

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 in studio and view code changes.

Depends on

PR yeagerai/genlayer-js#50
PR #796 (based on the pr branch)

Doubt

genlayer-studio code should point to the genlayer-js version containing the update.

User facing release notes

When the read method button is pressed, it will output the accepted and the finalized contact state.

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 23 commits December 19, 2024 16:56
…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
…transactions-to-pending' into 783-consensus-store-acceptance-and-finalized-states-on-contracts
…contracts' into 790-consensus-restore-contract-state-after-appeal-fail
…it inclusing for appeals, rollback restores the state with it as it is the state before applying the write method
@kstroobants kstroobants self-assigned this Jan 8, 2025
@kstroobants kstroobants requested a review from cristiam86 January 8, 2025 17:40
@kstroobants
Copy link
Contributor Author

both tests fail because they depend on genlayer-js

Copy link

sonarqubecloud bot commented Jan 8, 2025

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

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

Project coverage is 18.12%. Comparing base (c8d7fe9) to head (a2e2692).

Files with missing lines Patch % Lines
...nd/src/components/Simulator/ContractMethodItem.vue 0.00% 35 Missing ⚠️
...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 ⚠️
frontend/src/hooks/useContractQueries.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #801      +/-   ##
==========================================
- Coverage   18.21%   18.12%   -0.09%     
==========================================
  Files         129      129              
  Lines       10076    10123      +47     
  Branches      302      302              
==========================================
  Hits         1835     1835              
- Misses       8156     8203      +47     
  Partials       85       85              

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

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.

Consensus: frontend get method should show accepted and finalized contract state
1 participant