-
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.
Handle transaction re-pricing and multiple inclusion (#36)
* EL mock * WIP mock server * wait for mined block * can mine blocks * advance head on mine * Handle multiple inclusions * update tests * fix tests * lint * docs * remove fee estimator
- Loading branch information
Showing
27 changed files
with
1,741 additions
and
637 deletions.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
.sqlx/query-a6ccf35f6bd2d265828b86c39a1e5a5a2674554f7b2256832ea4a8b9e7fe5d72.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
.sqlx/query-cee4100ac96df98989003c4c6815ab6a2ba4353fffad9aef8041f12f3dcd05f4.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
.sqlx/query-f65e441cbfac899e816a4ede485992496ca160fe37254bfe24476b5b3c77d821.json
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
33 changes: 33 additions & 0 deletions
33
migrations/20240101133133_create_intent_inclusion_table.sql
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,33 @@ | ||
-- # Queries | ||
-- * List of intent IDs that can be included in a new bundle (no inclusion + underpriced inclusion) | ||
-- > Query all rows with nonce > finalized nonce for sender address | ||
-- * For a specific historic intent ID, retrieve which transaction and block is included into efficiently | ||
-- > Query rows WHERE id = ? and pick the most recent or canonical | ||
-- * Prune inclusions for dropped transactions | ||
-- > Remove rows WHERE tx_hash = ? | ||
-- | ||
-- # Pruning | ||
-- Prunes non canonical re-priced transactions | ||
-- | ||
-- # Mutation | ||
-- None | ||
-- | ||
CREATE TABLE intent_inclusions ( | ||
-- data intent UUID as binary | ||
id BINARY(16) NOT NULL, | ||
-- Transaction hash that includes this set of IDs | ||
tx_hash BINARY(32) NOT NULL, | ||
-- Tx from | ||
sender_address BINARY(20) NOT NULL, | ||
-- Tx nonce from sender | ||
nonce INT NOT NULL, | ||
-- Timestamp with milisecond level precision, automatically populated | ||
updated_at TIMESTAMP(3) DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), | ||
|
||
PRIMARY KEY(id, tx_hash), | ||
-- Allow to query inclusions by data intent ID or transaction hash | ||
INDEX(id), | ||
INDEX(tx_hash), | ||
INDEX(sender_address), | ||
INDEX(nonce) | ||
); |
Oops, something went wrong.