forked from okx/xlayer-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revamp sequencer and aggregator integration with ethtxmanager (0xPoly…
…gonHermez#1330) * move sequence to state and create persistence methods * WIP * conclude sequence persistence * ethtxmanager refactor to work with sequence groups * fix sql * implemented sequence groups * WIP * WIP * WIP * refactoring how to send proofs to l1 * aggregator l1 tx management * remove unused method from etherman * readd l1 network to deploy sc script * remove duplicated sequence group logic * db schema modified * sequence table removed * tryToSendVerifiedBatch removed * fixes * migration fixed * fix txHash update in db Co-authored-by: Alonso <[email protected]>
- Loading branch information
Showing
36 changed files
with
1,067 additions
and
504 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
-- +migrate Up | ||
ALTER TABLE state.proof ADD COLUMN proof_id VARCHAR; | ||
ALTER TABLE state.proof ADD COLUMN input_prover jsonb; | ||
ALTER TABLE state.proof ADD COLUMN prover VARCHAR; | ||
|
||
-- +migrate Down | ||
ALTER TABLE state.proof DROP COLUMN prover; | ||
ALTER TABLE state.proof DROP COLUMN input_prover; | ||
ALTER TABLE state.proof DROP COLUMN proof_id; | ||
|
||
|
||
-- +migrate Up | ||
ALTER TABLE state.proof ADD COLUMN proof_id VARCHAR; | ||
ALTER TABLE state.proof ADD COLUMN input_prover jsonb; | ||
ALTER TABLE state.proof ADD COLUMN prover VARCHAR; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
-- +migrate Down | ||
DROP TABLE state.sequence_group; | ||
|
||
ALTER TABLE state.proof DROP COLUMN tx_hash; | ||
ALTER TABLE state.proof DROP COLUMN tx_nonce; | ||
ALTER TABLE state.proof DROP COLUMN status; | ||
ALTER TABLE state.proof DROP COLUMN created_at; | ||
ALTER TABLE state.proof DROP COLUMN updated_at; | ||
|
||
-- +migrate Up | ||
CREATE TABLE state.sequence_group | ||
( | ||
tx_hash VARCHAR, | ||
tx_nonce DECIMAL(78, 0), | ||
from_batch_num BIGINT NOT NULL REFERENCES state.batch (batch_num) ON DELETE CASCADE, | ||
to_batch_num BIGINT NOT NULL REFERENCES state.batch (batch_num) ON DELETE CASCADE, | ||
status VARCHAR(15) NOT NULL, | ||
created_at TIMESTAMP WITH TIME ZONE NOT NULL, | ||
updated_at TIMESTAMP WITH TIME ZONE, | ||
PRIMARY KEY (tx_hash) | ||
); | ||
|
||
ALTER TABLE state.proof ADD COLUMN tx_hash VARCHAR; | ||
ALTER TABLE state.proof ADD COLUMN tx_nonce DECIMAL(78, 0); | ||
ALTER TABLE state.proof ADD COLUMN status VARCHAR(15); | ||
ALTER TABLE state.proof ADD COLUMN created_at TIMESTAMP WITH TIME ZONE; | ||
ALTER TABLE state.proof ADD COLUMN updated_at TIMESTAMP WITH TIME ZONE; | ||
|
||
UPDATE state.proof SET created_at = NOW(); | ||
UPDATE state.proof SET status = 'pending' WHERE batch_num > (SELECT batch_num from state.verified_batch ORDER BY batch_num DESC LIMIT 1); | ||
UPDATE state.proof SET status = 'confirmed', updated_at = NOW() WHERE batch_num <= (SELECT batch_num from state.verified_batch ORDER BY batch_num DESC LIMIT 1); | ||
|
||
ALTER TABLE state.proof ALTER COLUMN status SET NOT NULL; | ||
ALTER TABLE state.proof ALTER COLUMN created_at SET NOT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.