-
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.
[indexer] index protocol configs and feature flags (#18450)
## Description This PR adds two tables `protocol_configs` and `feature_flags` that get populated at indexer startup time and every epoch change time if protocol version has changed. ## Test plan Tested locally against devnet. --- ## 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 two new indexer tables that stores protocol configs and features flags of different versions. - [ ] JSON-RPC: - [x] GraphQL: uses the stored data to query for protocol configs instead of native configs stored in the binary. - [ ] CLI: - [ ] Rust SDK:
- Loading branch information
Showing
13 changed files
with
366 additions
and
62 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
40 changes: 40 additions & 0 deletions
40
crates/sui-graphql-e2e-tests/tests/epoch/protocol_configs.exp
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,40 @@ | ||
processed 4 tasks | ||
|
||
init: | ||
C: object(0,0) | ||
|
||
task 1, line 6: | ||
//# create-checkpoint | ||
Checkpoint created: 1 | ||
|
||
task 2, lines 8-19: | ||
//# run-graphql | ||
Response: { | ||
"data": { | ||
"protocolConfig": { | ||
"protocolVersion": 51, | ||
"config": { | ||
"value": "128" | ||
}, | ||
"featureFlag": { | ||
"value": true | ||
} | ||
} | ||
} | ||
} | ||
|
||
task 3, lines 21-32: | ||
//# run-graphql | ||
Response: { | ||
"data": { | ||
"protocolConfig": { | ||
"protocolVersion": 8, | ||
"config": { | ||
"value": null | ||
}, | ||
"featureFlag": { | ||
"value": false | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
crates/sui-graphql-e2e-tests/tests/epoch/protocol_configs.move
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,32 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
//# init --protocol-version 51 --simulator --accounts C | ||
|
||
//# create-checkpoint | ||
|
||
//# run-graphql | ||
{ | ||
protocolConfig { | ||
protocolVersion | ||
config(key: "max_move_identifier_len") { | ||
value | ||
} | ||
featureFlag(key: "enable_coin_deny_list") { | ||
value | ||
} | ||
} | ||
} | ||
|
||
//# run-graphql | ||
{ | ||
protocolConfig(protocolVersion: 8) { | ||
protocolVersion | ||
config(key: "max_move_identifier_len") { | ||
value | ||
} | ||
featureFlag(key: "enable_coin_deny_list") { | ||
value | ||
} | ||
} | ||
} |
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
Oops, something went wrong.