Skip to content

Commit

Permalink
Remove deleted protocol fields from older snapshots to avoid spurious…
Browse files Browse the repository at this point in the history
… failures (#18715)

- Remove bad changes from cargo insta
- Remove deleted protocol fields from older snapshots to avoid spurious
failures
  • Loading branch information
mystenmark authored Jul 18, 2024
1 parent 9417279 commit 66b19f7
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: crates/sui-protocol-config/src/lib.rs
assertion_line: 1578
expression: "ProtocolConfig::get_for_version(cur, *chain_id)"
---
version: 21
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,3 @@ max_age_of_jwk_in_epochs: 1
random_beacon_reduction_allowed_delta: 800
consensus_max_transaction_size_bytes: 262144
consensus_max_transactions_in_block_bytes: 6291456

Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,3 @@ random_beacon_reduction_allowed_delta: 800
consensus_max_transaction_size_bytes: 262144
consensus_max_transactions_in_block_bytes: 6291456
max_deferral_rounds_for_congestion_control: 10

Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,3 @@ max_age_of_jwk_in_epochs: 1
random_beacon_reduction_allowed_delta: 800
consensus_max_transaction_size_bytes: 262144
consensus_max_transactions_in_block_bytes: 6291456

Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,3 @@ consensus_max_transactions_in_block_bytes: 6291456
max_deferral_rounds_for_congestion_control: 10
min_checkpoint_interval_ms: 200
checkpoint_summary_version_specific_data: 1

13 changes: 13 additions & 0 deletions scripts/compatibility/check-protocol-compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ else
fi

echo "Checking for changes to snapshot files matching $NETWORK_PATTERN"

# The fields `scoring_decision_mad_divisor`, `scoring_decision_cutoff_value` were removed from the protocol config,
# but they are still present in older snapshot files. We need to delete them from the snapshot files before
# checking if the git repo is clean.
# TODO: Remove this workaround once commit 3959d9af51172824b0e4f20802c71e416596c7df has been release to all networks.
SED=$(which gsed)
if [ -z "$SED" ]; then
SED=$(which sed)
fi

grep -lE 'scoring_decision_mad_divisor|scoring_decision_cutoff_value' crates/sui-protocol-config/src/snapshots/$NETWORK_PATTERN | xargs $SED -Ei '/(scoring_decision_mad_divisor|scoring_decision_cutoff_value)/d'
git add .

check_git_clean "Detected changes to snapshot files since $ORIGIN_COMMIT - not safe to release" "$NETWORK_PATTERN"

# remove any snapshot file changes that were ignored
Expand Down

0 comments on commit 66b19f7

Please sign in to comment.