-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: re-activate reorg support (#737)
- Loading branch information
Showing
23 changed files
with
119 additions
and
95 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
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
8 changes: 4 additions & 4 deletions
8
internal/blocktx/integration_test/fixtures/reorg/blocktx.block_transactions.yaml
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,12 +1,12 @@ | ||
- block_id: 1002 | ||
hash: 0xb16cea53fc823e146fbb9ae4ad3124f7c273f30562585ad6e4831495d609f430 | ||
merkle_tree_index: 3 | ||
merkle_tree_index: 0 | ||
- block_id: 1999 # the same tx also in stale block | ||
hash: 0xb16cea53fc823e146fbb9ae4ad3124f7c273f30562585ad6e4831495d609f430 | ||
merkle_tree_index: 999 | ||
merkle_tree_index: 0 | ||
- block_id: 1999 # the same tx also in stale block | ||
hash: 0xcd3d2f97dfc0cdb6a07ec4b72df5e1794c9553ff2f62d90ed4add047e8088853 | ||
merkle_tree_index: 999 | ||
merkle_tree_index: 1 | ||
- block_id: 1004 | ||
hash: 0xece2b7e40d98749c03c551b783420d6e3fdc3c958244bbf275437839585829a6 | ||
merkle_tree_index: 5 | ||
merkle_tree_index: 0 |
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
8 changes: 8 additions & 0 deletions
8
internal/blocktx/integration_test/fixtures/reorg/blocktx.registered_transactions.yaml
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,8 @@ | ||
- hash: 0xcd3d2f97dfc0cdb6a07ec4b72df5e1794c9553ff2f62d90ed4add047e8088853 | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0xb16cea53fc823e146fbb9ae4ad3124f7c273f30562585ad6e4831495d609f430 | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0x2ff4430eb883c6f6c0640a5d716b2d107bbc0efa5aeaa237aec796d4686b0a8f | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0xece2b7e40d98749c03c551b783420d6e3fdc3c958244bbf275437839585829a6 | ||
inserted_at: 2023-12-15 14:00:00 |
10 changes: 5 additions & 5 deletions
10
internal/blocktx/integration_test/fixtures/reorg_orphans/blocktx.block_transactions.yaml
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,15 +1,15 @@ | ||
- block_id: 1002 | ||
hash: 0xcd3d2f97dfc0cdb6a07ec4b72df5e1794c9553ff2f62d90ed4add047e8088853 | ||
merkle_tree_index: 1 | ||
merkle_tree_index: 0 | ||
- block_id: 1002 | ||
hash: 0xb16cea53fc823e146fbb9ae4ad3124f7c273f30562585ad6e4831495d609f430 | ||
merkle_tree_index: 3 | ||
merkle_tree_index: 1 | ||
- block_id: 1004 | ||
hash: 0xb16cea53fc823e146fbb9ae4ad3124f7c273f30562585ad6e4831495d609f430 | ||
merkle_tree_index: 3 | ||
merkle_tree_index: 0 | ||
- block_id: 1003 | ||
hash: 0x2ff4430eb883c6f6c0640a5d716b2d107bbc0efa5aeaa237aec796d4686b0a8f | ||
merkle_tree_index: 4 | ||
merkle_tree_index: 0 | ||
- block_id: 1006 | ||
hash: 0xece2b7e40d98749c03c551b783420d6e3fdc3c958244bbf275437839585829a6 | ||
merkle_tree_index: 5 | ||
merkle_tree_index: 0 |
8 changes: 8 additions & 0 deletions
8
...rnal/blocktx/integration_test/fixtures/reorg_orphans/blocktx.registered_transactions.yaml
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,8 @@ | ||
- hash: 0xcd3d2f97dfc0cdb6a07ec4b72df5e1794c9553ff2f62d90ed4add047e8088853 | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0xb16cea53fc823e146fbb9ae4ad3124f7c273f30562585ad6e4831495d609f430 | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0x2ff4430eb883c6f6c0640a5d716b2d107bbc0efa5aeaa237aec796d4686b0a8f | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0xece2b7e40d98749c03c551b783420d6e3fdc3c958244bbf275437839585829a6 | ||
inserted_at: 2023-12-15 14:00:00 |
8 changes: 0 additions & 8 deletions
8
internal/blocktx/integration_test/fixtures/stale_orphans/blocktx.block_transactions_map.yaml
This file was deleted.
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
28 changes: 14 additions & 14 deletions
28
.../store/postgresql/fixtures/insert_block_transactions/blocktx.registered_transactions.yaml
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,16 +1,16 @@ | ||
#- hash: 0x76732b80598326a18d3bf0a86518adbdf95d0ddc6ff6693004440f4776168c3b | ||
# inserted_at: 2023-12-15 14:00:00 | ||
#- hash: 0x164e85a5d5bc2b2372e8feaa266e5e4b7d0808f8d2b784fb1f7349c4726392b0 | ||
# inserted_at: 2023-12-15 14:00:00 | ||
#- hash: 0xb4201cc6fc5768abff14adf75042ace6061da9176ee5bb943291b9ba7d7f5743 | ||
# inserted_at: 2023-12-15 14:00:00 | ||
#- hash: 0x37bd6c87927e75faeb3b3c939f64721cda48e1bb98742676eebe83aceee1a669 | ||
# inserted_at: 2023-12-15 14:00:00 | ||
#- hash: 0x952f80e20a0330f3b9c2dfd1586960064e797218b5c5df665cada221452c17eb | ||
# inserted_at: 2023-12-15 14:00:00 | ||
#- hash: 0x861a281b27de016e50887288de87eab5ca56a1bb172cdff6dba965474ce0f608 | ||
# inserted_at: 2023-12-15 14:00:00 | ||
#- hash: 0x9421cc760c5405af950a76dc3e4345eaefd4e7322f172a3aee5e0ddc7b4f8313 | ||
# inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0x76732b80598326a18d3bf0a86518adbdf95d0ddc6ff6693004440f4776168c3b | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0x164e85a5d5bc2b2372e8feaa266e5e4b7d0808f8d2b784fb1f7349c4726392b0 | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0xb4201cc6fc5768abff14adf75042ace6061da9176ee5bb943291b9ba7d7f5743 | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0x37bd6c87927e75faeb3b3c939f64721cda48e1bb98742676eebe83aceee1a669 | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0x952f80e20a0330f3b9c2dfd1586960064e797218b5c5df665cada221452c17eb | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0x861a281b27de016e50887288de87eab5ca56a1bb172cdff6dba965474ce0f608 | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0x9421cc760c5405af950a76dc3e4345eaefd4e7322f172a3aee5e0ddc7b4f8313 | ||
inserted_at: 2023-12-15 14:00:00 | ||
- hash: 0x8b7d038db4518ac4c665abfc5aeaacbd2124ad8ca70daa8465ed2c4427c41b9b | ||
inserted_at: 2023-12-15 14:00:00 |
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
1 change: 1 addition & 0 deletions
1
internal/blocktx/store/postgresql/migrations/000023_unique_height_is_longest.down.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 @@ | ||
DROP INDEX blocktx.pux_height_is_longest; |
4 changes: 4 additions & 0 deletions
4
internal/blocktx/store/postgresql/migrations/000023_unique_height_is_longest.up.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,4 @@ | ||
-- This will make sure that there can only be ONE block at any | ||
-- given height that is considered part of the LONGEST chain. | ||
CREATE UNIQUE INDEX pux_height_is_longest ON blocktx.blocks(height) | ||
WHERE is_longest; |
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.