Skip to content

Commit 72773a7

Browse files
authored
Cherry-pick #25361 (#25366)
## Description Cherry pick and updated snapshots ## Test plan How did you test the new or updated feature? --- ## 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. - [x] Protocol: 111 makes more consistent check across execution mode and transaction data - [ ] Nodes (Validators and Full nodes): - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] Indexing Framework:
1 parent 5057c1d commit 72773a7

File tree

18 files changed

+1897
-104
lines changed

18 files changed

+1897
-104
lines changed

crates/sui-core/src/authority.rs

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ use sui_types::effects::{
133133
use sui_types::error::{ExecutionError, SuiErrorKind, UserInputError};
134134
use sui_types::event::{Event, EventID};
135135
use sui_types::executable_transaction::VerifiedExecutableTransaction;
136-
use sui_types::gas::{GasCostSummary, SuiGasStatus};
136+
use sui_types::gas::GasCostSummary;
137137
use sui_types::inner_temporary_store::{
138138
InnerTemporaryStore, ObjectMap, TemporaryModuleResolver, TxCoins, WrittenObjects,
139139
};
@@ -2581,20 +2581,13 @@ impl AuthorityState {
25812581
&self.config.verifier_signing_config,
25822582
)?
25832583
} else {
2584-
let checked_input_objects = sui_transaction_checks::check_dev_inspect_input(
2584+
sui_transaction_checks::check_dev_inspect_input(
25852585
protocol_config,
2586-
transaction.kind(),
2586+
&transaction,
25872587
input_objects,
25882588
receiving_objects,
2589-
)?;
2590-
let gas_status = SuiGasStatus::new(
2591-
transaction.gas_budget(),
2592-
transaction.gas_price(),
25932589
epoch_store.reference_gas_price(),
2594-
protocol_config,
2595-
)?;
2596-
2597-
(gas_status, checked_input_objects)
2590+
)?
25982591
};
25992592

26002593
// TODO see if we can spin up a VM once and reuse it
@@ -2790,20 +2783,13 @@ impl AuthorityState {
27902783
dummy_gas_object.into(),
27912784
));
27922785
}
2793-
let checked_input_objects = sui_transaction_checks::check_dev_inspect_input(
2786+
sui_transaction_checks::check_dev_inspect_input(
27942787
protocol_config,
2795-
&transaction_kind,
2788+
&transaction,
27962789
input_objects,
27972790
receiving_objects,
2798-
)?;
2799-
let gas_status = SuiGasStatus::new(
2800-
max_tx_gas,
2801-
transaction.gas_price(),
28022791
reference_gas_price,
2803-
protocol_config,
2804-
)?;
2805-
2806-
(gas_status, checked_input_objects)
2792+
)?
28072793
} else {
28082794
// If we are not skipping checks, then we call the check_transaction_input function and its dummy gas
28092795
// variant which will perform full fledged checks just like a real transaction execution.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
---
2+
source: crates/sui-core/src/authority/execution_time_estimator.rs
3+
expression: snapshot_data
4+
---
5+
protocol_version: 111
6+
consensus_observations:
7+
- - MakeMoveVec
8+
- observations:
9+
- - 8
10+
- secs: 0
11+
nanos: 25000000
12+
- - 9
13+
- secs: 0
14+
nanos: 25000000
15+
- - 5
16+
- secs: 0
17+
nanos: 19000000
18+
- - 1
19+
- secs: 0
20+
nanos: 25000000
21+
stake_weighted_median:
22+
secs: 0
23+
nanos: 25000000
24+
- - MergeCoins
25+
- observations:
26+
- - 6
27+
- secs: 0
28+
nanos: 63000000
29+
- - 1
30+
- secs: 0
31+
nanos: 21000000
32+
- - 7
33+
- secs: 0
34+
nanos: 0
35+
- - 7
36+
- secs: 0
37+
nanos: 0
38+
stake_weighted_median:
39+
secs: 0
40+
nanos: 21000000
41+
- - SplitCoins
42+
- observations:
43+
- - 0
44+
- ~
45+
- - 2
46+
- secs: 0
47+
nanos: 71000000
48+
- - 7
49+
- secs: 0
50+
nanos: 25000000
51+
- - 3
52+
- secs: 0
53+
nanos: 61000000
54+
stake_weighted_median:
55+
secs: 0
56+
nanos: 61000000
57+
- - TransferObjects
58+
- observations:
59+
- - 0
60+
- ~
61+
- - 0
62+
- ~
63+
- - 7
64+
- secs: 0
65+
nanos: 21000000
66+
- - 9
67+
- secs: 0
68+
nanos: 27000000
69+
stake_weighted_median:
70+
secs: 0
71+
nanos: 27000000
72+
- - Upgrade
73+
- observations:
74+
- - 0
75+
- ~
76+
- - 9
77+
- secs: 0
78+
nanos: 285000000
79+
- - 6
80+
- secs: 0
81+
nanos: 981000000
82+
- - 4
83+
- secs: 0
84+
nanos: 587000000
85+
stake_weighted_median:
86+
secs: 0
87+
nanos: 587000000
88+
- - MoveEntryPoint:
89+
package: "0x0000000000000000000000000000000000000000000000000000000000000001"
90+
module: coin
91+
function: transfer
92+
type_arguments: []
93+
- observations:
94+
- - 9
95+
- secs: 0
96+
nanos: 65000000
97+
- - 7
98+
- secs: 0
99+
nanos: 400000000
100+
- - 10
101+
- secs: 0
102+
nanos: 249000000
103+
- - 0
104+
- ~
105+
stake_weighted_median:
106+
secs: 0
107+
nanos: 249000000
108+
- - MoveEntryPoint:
109+
package: "0x0000000000000000000000000000000000000000000000000000000000000002"
110+
module: nft
111+
function: mint
112+
type_arguments: []
113+
- observations:
114+
- - 0
115+
- ~
116+
- - 0
117+
- ~
118+
- - 3
119+
- secs: 0
120+
nanos: 99000000
121+
- - 8
122+
- secs: 0
123+
nanos: 499000000
124+
stake_weighted_median:
125+
secs: 0
126+
nanos: 499000000
127+
transaction_estimates:
128+
- - coin_transfer_call
129+
- secs: 0
130+
nanos: 249000000
131+
- - mixed_move_calls
132+
- secs: 0
133+
nanos: 748000000
134+
- - native_commands_with_observations
135+
- secs: 0
136+
nanos: 268000000
137+
- - transfer_objects_3_items
138+
- secs: 0
139+
nanos: 108000000
140+
- - split_coins_1_amounts
141+
- secs: 0
142+
nanos: 122000000
143+
- - merge_coins_1_sources
144+
- secs: 0
145+
nanos: 42000000
146+
- - make_move_vec_6_elements
147+
- secs: 0
148+
nanos: 175000000
149+
- - mixed_commands
150+
- secs: 0
151+
nanos: 204000000
152+
- - upgrade_package
153+
- secs: 0
154+
nanos: 587000000

crates/sui-open-rpc/spec/openrpc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@
12941294
"name": "Result",
12951295
"value": {
12961296
"minSupportedProtocolVersion": "1",
1297-
"maxSupportedProtocolVersion": "110",
1297+
"maxSupportedProtocolVersion": "111",
12981298
"protocolVersion": "6",
12991299
"featureFlags": {
13001300
"abstract_size_in_object_runtime": false,
@@ -1433,6 +1433,7 @@
14331433
"use_new_commit_handler": false,
14341434
"validate_identifier_inputs": false,
14351435
"validate_zklogin_public_identifier": false,
1436+
"validator_metadata_verify_v2": false,
14361437
"variant_nodes": false,
14371438
"verify_legacy_zklogin_address": false,
14381439
"zklogin_auth": false

crates/sui-protocol-config/src/lib.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use tracing::{info, warn};
2424

2525
/// The minimum and maximum protocol versions supported by this build.
2626
const MIN_PROTOCOL_VERSION: u64 = 1;
27-
const MAX_PROTOCOL_VERSION: u64 = 110;
27+
const MAX_PROTOCOL_VERSION: u64 = 111;
2828

2929
// Record history of protocol version allocations here:
3030
//
@@ -295,6 +295,7 @@ const MAX_PROTOCOL_VERSION: u64 = 110;
295295
// function on mainnet.
296296
// split_checkpoints_in_consensus_handler in devnet
297297
// Enable additional validation on zkLogin public identifier.
298+
// Version 111: Validator metadata
298299

299300
#[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
300301
pub struct ProtocolVersion(u64);
@@ -979,6 +980,10 @@ struct FeatureFlags {
979980
// If true, always accept committed system transactions.
980981
#[serde(skip_serializing_if = "is_false")]
981982
consensus_always_accept_system_transactions: bool,
983+
984+
// If true perform consistent verification of metadata
985+
#[serde(skip_serializing_if = "is_false")]
986+
validator_metadata_verify_v2: bool,
982987
}
983988

984989
fn is_false(b: &bool) -> bool {
@@ -2573,6 +2578,10 @@ impl ProtocolConfig {
25732578
self.feature_flags
25742579
.consensus_always_accept_system_transactions
25752580
}
2581+
2582+
pub fn validator_metadata_verify_v2(&self) -> bool {
2583+
self.feature_flags.validator_metadata_verify_v2
2584+
}
25762585
}
25772586

25782587
#[cfg(not(msim))]
@@ -4528,6 +4537,9 @@ impl ProtocolConfig {
45284537
cfg.feature_flags.enable_object_funds_withdraw = true;
45294538
}
45304539
}
4540+
111 => {
4541+
cfg.feature_flags.validator_metadata_verify_v2 = true;
4542+
}
45314543
// Use this template when making changes:
45324544
//
45334545
// // modify an existing constant.

0 commit comments

Comments
 (0)