You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: consensus appeals use wrong contract state and restore contract state after appeal successful (#799)
* feat: add rollup transaction db table
* fix: drop audit table, change id and nonce of rollup, only make one finalized rollup transaction
* create rollup transaction for every validator
* add function to mock in consensus test
* feat: add appeal window, accepted queue, basic test
* fix: old tests were stuck on accepted state, add usage of thread
* refactor consensus into states
* feat: added appeal flow when transaction is accepted including the loop when appeal failed and succeeded
* fix: adding tests for appeals and fixing minor bugs
* refactor: merge main and PR #573 into this branch
* feat: add appeal_failed in db, select new validators when appealed based on formula
* docs: cleanup consensus mechanism base file
* test: checking the number of validators for different appeals
* feat: adding appeal window to undetermined state
* feat: change timestamp_accepted and add appeal_undetermined in database
* feat: undetermined to pending, activate frontend button in undetermined state and add button also to modal
* feat: leader only has no appeal button and no appeal window
* feat: implement the state transitions to process the appeal
- 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
* test: add test for leader appeals
* refactor: merge 593-appeals-add-validators-when-appealed into 604-appeals-implement-sequential-appeals-fail
* refactor: merging changed file permissions
* fix: appealing a write method gave a KeyError because of wrong conversation of transaction
* docs: update transaction_processor argument description
* fix: all appeals disagreed because of pending_transactions type
* refactor: undo change because of merge
* fix: do not reset finality window when leader appeal failed, leader_only check in appeal_window
* fix: set value in database migration file
* fix: add leader_only check for modal appeal button, comment out modal appeal button
* fix: do not show appeal button when finality window is finished, checking on finalized state gave a small delay in showing when appeal failed and finality window was exceeded
* fix: 2nd tx should not finish before 1st tx
* feat: add stop event async tasks, empty pending queue, rollback newer transactions to pending
* refactor: remove print statements wrt queue
* fix: keep the same validator set when tx is rollbacked
* fix: we do not emit messages when the transaction goes from undetermined to finalized
* fix: complete merge
* fix: redirect leader appeal is processed by appeal queue, not pending queue
* fix: test increase wait time to get to finalized
* fix: add rollback to pending of newer transactions for leader appeals
* fix: use appeal property of the transaction in frontend
* fix: comment out appeal buttons
* feat: contract contains accepted and finalized state
* fix: update old version of state of an existing contract, use accepted contract state in encoded_state for _SnapshotView reads and writes
* feat:restore contract state after validator appeal success
* fix: reusing validators after rollback clean up
* feat: add contractsnapshot to transaction, leader and validators use it inclusing for appeals, rollback restores the state with it as it is the state before applying the write method
* fix: remove print statement
* fix: leader appeal should keep the contract_snapshot
* refactor: clean up prints
* refactor: clean up prints
* fix: typo in test_helpers for consensus
* fix: resolve consensus base test fails
* fix: check status typo
* fix: update consensus test
* fix: update test_get_highest_timestamp
* fix: add activated to status match check in consensus test
* fix: add none check when transforming to dict for contract_snapshot
* fix: increase timings for failed test
* fix: put contract_snapshot to none in rollback function; set contract_snapshot in accepted state intead of proposing state
* Trigger GitHub Actions workflow
* fix: remove temporary code testing
---------
Co-authored-by: Cristiam Da Silva <cristiam86@gmail.com>
Copy file name to clipboardexpand all lines: backend/database_handler/contract_snapshot.py
+28
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# database_handler/contract_snapshot.py
2
2
from .modelsimportCurrentState
3
3
fromsqlalchemy.ormimportSession
4
+
fromtypingimportOptional
4
5
5
6
6
7
# TODO: should ContractSnapshot be a dataclass with just the contract data? Snapshots shouldn't be allowed to be modified, so it doesn't make sense to modify the database
0 commit comments