-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ConsensusV2 object support to
sui-indexer{,alt}
(#20486)
Updates `sum_coin_balances` and `wal_coin_balances` tables to add a column for `coin_owner_kind`, so that balances can be tracked separately for fastpath vs. consensus coins. --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [x] Indexer: Adds `coin_owner_kind` column to coin balances tables. - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
- Loading branch information
Showing
25 changed files
with
106 additions
and
12 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
5 changes: 5 additions & 0 deletions
5
crates/sui-indexer-alt/migrations/2024-12-02-185822_add_coin_balance_owner_kind/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,5 @@ | ||
ALTER TABLE sum_coin_balances | ||
DROP COLUMN owner_kind; | ||
|
||
ALTER TABLE wal_coin_balances | ||
DROP COLUMN owner_kind; |
1 change: 1 addition & 0 deletions
1
...es/sui-indexer-alt/migrations/2024-12-02-185822_add_coin_balance_owner_kind/metadata.toml
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 @@ | ||
run_in_transaction = false |
6 changes: 6 additions & 0 deletions
6
crates/sui-indexer-alt/migrations/2024-12-02-185822_add_coin_balance_owner_kind/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,6 @@ | ||
ALTER TABLE sum_coin_balances | ||
ADD COLUMN coin_owner_kind SMALLINT NOT NULL DEFAULT 1; | ||
|
||
ALTER TABLE wal_coin_balances | ||
ADD COLUMN coin_owner_kind SMALLINT; | ||
UPDATE wal_coin_balances SET coin_owner_kind = 1 WHERE owner_id IS NOT NULL; |
2 changes: 2 additions & 0 deletions
2
...sui-indexer-alt/migrations/2024-12-05-153042_add_coin_balance_owner_kind_indexes/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,2 @@ | ||
CREATE INDEX CONCURRENTLY IF NOT EXISTS sum_coin_balances_owner_type | ||
ON sum_coin_balances (owner_id, coin_type, coin_balance, object_id, object_version); |
1 change: 1 addition & 0 deletions
1
...ndexer-alt/migrations/2024-12-05-153042_add_coin_balance_owner_kind_indexes/metadata.toml
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 @@ | ||
run_in_transaction = false |
1 change: 1 addition & 0 deletions
1
...s/sui-indexer-alt/migrations/2024-12-05-153042_add_coin_balance_owner_kind_indexes/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 @@ | ||
DROP INDEX CONCURRENTLY IF EXISTS sum_coin_balances_owner_type; |
1 change: 1 addition & 0 deletions
1
...sui-indexer-alt/migrations/2024-12-05-162242_add_coin_balance_owner_kind_indexes/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 CONCURRENTLY IF EXISTS sum_coin_balances_owner_kind_owner_id_type; |
1 change: 1 addition & 0 deletions
1
...ndexer-alt/migrations/2024-12-05-162242_add_coin_balance_owner_kind_indexes/metadata.toml
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 @@ | ||
run_in_transaction = false |
2 changes: 2 additions & 0 deletions
2
...s/sui-indexer-alt/migrations/2024-12-05-162242_add_coin_balance_owner_kind_indexes/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,2 @@ | ||
CREATE INDEX CONCURRENTLY IF NOT EXISTS sum_coin_balances_owner_kind_owner_id_type | ||
ON sum_coin_balances (coin_owner_kind, owner_id, coin_type, coin_balance, object_id, object_version); |
2 changes: 2 additions & 0 deletions
2
...sui-indexer-alt/migrations/2024-12-05-162243_add_coin_balance_owner_kind_indexes/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,2 @@ | ||
CREATE INDEX CONCURRENTLY IF NOT EXISTS wal_coin_balances_owner_type | ||
ON wal_coin_balances (owner_id, coin_type, coin_balance, object_id, object_version); |
1 change: 1 addition & 0 deletions
1
...ndexer-alt/migrations/2024-12-05-162243_add_coin_balance_owner_kind_indexes/metadata.toml
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 @@ | ||
run_in_transaction = false |
1 change: 1 addition & 0 deletions
1
...s/sui-indexer-alt/migrations/2024-12-05-162243_add_coin_balance_owner_kind_indexes/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 @@ | ||
DROP INDEX CONCURRENTLY IF EXISTS wal_coin_balances_owner_type; |
1 change: 1 addition & 0 deletions
1
...sui-indexer-alt/migrations/2024-12-05-162244_add_coin_balance_owner_kind_indexes/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 CONCURRENTLY IF EXISTS wal_coin_balances_owner_kind_owner_id_type; |
1 change: 1 addition & 0 deletions
1
...ndexer-alt/migrations/2024-12-05-162244_add_coin_balance_owner_kind_indexes/metadata.toml
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 @@ | ||
run_in_transaction = false |
2 changes: 2 additions & 0 deletions
2
...s/sui-indexer-alt/migrations/2024-12-05-162244_add_coin_balance_owner_kind_indexes/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,2 @@ | ||
CREATE INDEX CONCURRENTLY IF NOT EXISTS wal_coin_balances_owner_kind_owner_id_type | ||
ON wal_coin_balances (coin_owner_kind, owner_id, coin_type, coin_balance, object_id, object_version); |
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
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