Skip to content

Commit 577ca7d

Browse files
committed
fix(iota-protocol-config): move pre_consensus_sponsor_only_move_authentication to the end of the parameters list
1 parent 008b271 commit 577ca7d

2 files changed

Lines changed: 27 additions & 27 deletions

File tree

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

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,6 @@ struct FeatureFlags {
444444
#[serde(skip_serializing_if = "is_false")]
445445
enable_move_authentication_for_sponsor: bool,
446446

447-
// If true, only sponsor Move authentication is performed pre-consensus.
448-
#[serde(skip_serializing_if = "is_false")]
449-
pre_consensus_sponsor_only_move_authentication: bool,
450-
451447
// If true, the change epoch transaction will contain validator scores.
452448
#[serde(skip_serializing_if = "is_false")]
453449
pass_validator_scores_to_advance_epoch: bool,
@@ -484,6 +480,10 @@ struct FeatureFlags {
484480
// If true, perform additional borrow checks
485481
#[serde(skip_serializing_if = "is_false")]
486482
additional_borrow_checks: bool,
483+
484+
// If true, only sponsor Move authentication is performed pre-consensus.
485+
#[serde(skip_serializing_if = "is_false")]
486+
pre_consensus_sponsor_only_move_authentication: bool,
487487
}
488488

489489
fn is_true(b: &bool) -> bool {
@@ -1653,23 +1653,6 @@ impl ProtocolConfig {
16531653
enable_move_authentication_for_sponsor
16541654
}
16551655

1656-
pub fn pre_consensus_sponsor_only_move_authentication(&self) -> bool {
1657-
let pre_consensus_sponsor_only_move_authentication = self
1658-
.feature_flags
1659-
.pre_consensus_sponsor_only_move_authentication;
1660-
if pre_consensus_sponsor_only_move_authentication {
1661-
assert!(
1662-
self.enable_move_authentication(),
1663-
"pre_consensus_sponsor_only_move_authentication requires enable_move_authentication to be set"
1664-
);
1665-
assert!(
1666-
self.enable_move_authentication_for_sponsor(),
1667-
"pre_consensus_sponsor_only_move_authentication requires enable_move_authentication_for_sponsor to be set"
1668-
);
1669-
}
1670-
pre_consensus_sponsor_only_move_authentication
1671-
}
1672-
16731656
pub fn pass_validator_scores_to_advance_epoch(&self) -> bool {
16741657
self.feature_flags.pass_validator_scores_to_advance_epoch
16751658
}
@@ -1720,6 +1703,23 @@ impl ProtocolConfig {
17201703
pub fn move_native_tx_context(&self) -> bool {
17211704
self.feature_flags.move_native_tx_context
17221705
}
1706+
1707+
pub fn pre_consensus_sponsor_only_move_authentication(&self) -> bool {
1708+
let pre_consensus_sponsor_only_move_authentication = self
1709+
.feature_flags
1710+
.pre_consensus_sponsor_only_move_authentication;
1711+
if pre_consensus_sponsor_only_move_authentication {
1712+
assert!(
1713+
self.enable_move_authentication(),
1714+
"pre_consensus_sponsor_only_move_authentication requires enable_move_authentication to be set"
1715+
);
1716+
assert!(
1717+
self.enable_move_authentication_for_sponsor(),
1718+
"pre_consensus_sponsor_only_move_authentication requires enable_move_authentication_for_sponsor to be set"
1719+
);
1720+
}
1721+
pre_consensus_sponsor_only_move_authentication
1722+
}
17231723
}
17241724

17251725
#[cfg(not(msim))]
@@ -3038,18 +3038,18 @@ impl ProtocolConfig {
30383038
self.feature_flags.enable_move_authentication_for_sponsor = val;
30393039
}
30403040

3041-
pub fn set_pre_consensus_sponsor_only_move_authentication_for_testing(&mut self, val: bool) {
3042-
self.feature_flags
3043-
.pre_consensus_sponsor_only_move_authentication = val;
3044-
}
3045-
30463041
pub fn set_consensus_fast_commit_sync_for_testing(&mut self, val: bool) {
30473042
self.feature_flags.consensus_fast_commit_sync = val;
30483043
}
30493044

30503045
pub fn set_consensus_block_restrictions_for_testing(&mut self, val: bool) {
30513046
self.feature_flags.consensus_block_restrictions = val;
30523047
}
3048+
3049+
pub fn set_pre_consensus_sponsor_only_move_authentication_for_testing(&mut self, val: bool) {
3050+
self.feature_flags
3051+
.pre_consensus_sponsor_only_move_authentication = val;
3052+
}
30533053
}
30543054

30553055
type OverrideFn = dyn Fn(ProtocolVersion, ProtocolConfig) -> ProtocolConfig + Send + Sync;

crates/iota-protocol-config/src/snapshots/iota_protocol_config__test__version_27.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ feature_flags:
4343
publish_package_metadata: true
4444
enable_move_authentication: true
4545
enable_move_authentication_for_sponsor: true
46-
pre_consensus_sponsor_only_move_authentication: true
4746
pass_validator_scores_to_advance_epoch: true
4847
calculate_validator_scores: true
4948
adjust_rewards_by_score: true
@@ -52,6 +51,7 @@ feature_flags:
5251
consensus_block_restrictions: true
5352
move_native_tx_context: true
5453
additional_borrow_checks: true
54+
pre_consensus_sponsor_only_move_authentication: true
5555
max_tx_size_bytes: 131072
5656
max_input_objects: 2048
5757
max_size_written_objects: 5000000

0 commit comments

Comments
 (0)