Skip to content

Commit 53fb16b

Browse files
committed
reverted RejectCode::ReorgNotAllowed
1 parent 6c58b72 commit 53fb16b

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

libsigner/src/v0/messages.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,7 @@ RejectCodeTypePrefix {
539539
/// The block was rejected due to a mismatch with expected sortition view
540540
SortitionViewMismatch = 4,
541541
/// The block was rejected due to a testing directive
542-
TestingDirective = 5,
543-
/// The block was rejected due to an invalid reorg attempt
544-
ReorgNotAllowed = 6
542+
TestingDirective = 5
545543
});
546544

547545
impl TryFrom<u8> for RejectCodeTypePrefix {
@@ -562,7 +560,6 @@ impl From<&RejectCode> for RejectCodeTypePrefix {
562560
RejectCode::NoSortitionView => RejectCodeTypePrefix::NoSortitionView,
563561
RejectCode::SortitionViewMismatch => RejectCodeTypePrefix::SortitionViewMismatch,
564562
RejectCode::TestingDirective => RejectCodeTypePrefix::TestingDirective,
565-
RejectCode::ReorgNotAllowed => RejectCodeTypePrefix::ReorgNotAllowed,
566563
}
567564
}
568565
}
@@ -605,8 +602,6 @@ pub enum RejectCode {
605602
SortitionViewMismatch,
606603
/// The block was rejected due to a testing directive
607604
TestingDirective,
608-
/// The block was rejected due to an invalid reorg attempt
609-
ReorgNotAllowed,
610605
}
611606

612607
impl From<&RejectReason> for RejectCode {
@@ -620,7 +615,7 @@ impl From<&RejectReason> for RejectCode {
620615
RejectReason::RejectedInPriorRound => RejectCode::RejectedInPriorRound,
621616
RejectReason::SortitionViewMismatch => RejectCode::SortitionViewMismatch,
622617
RejectReason::TestingDirective => RejectCode::TestingDirective,
623-
RejectReason::ReorgNotAllowed => RejectCode::ReorgNotAllowed,
618+
RejectReason::ReorgNotAllowed => RejectCode::SortitionViewMismatch,
624619
// Newer reject reasons were expanded from SortitionViewMismatch
625620
_ => RejectCode::SortitionViewMismatch,
626621
}
@@ -767,7 +762,6 @@ impl From<&RejectCode> for RejectReason {
767762
RejectCode::NoSortitionView => RejectReason::NoSortitionView,
768763
RejectCode::SortitionViewMismatch => RejectReason::SortitionViewMismatch,
769764
RejectCode::TestingDirective => RejectReason::TestingDirective,
770-
RejectCode::ReorgNotAllowed => RejectReason::ReorgNotAllowed,
771765
}
772766
}
773767
}
@@ -1278,8 +1272,7 @@ impl StacksMessageCodec for RejectCode {
12781272
| RejectCode::RejectedInPriorRound
12791273
| RejectCode::NoSortitionView
12801274
| RejectCode::SortitionViewMismatch
1281-
| RejectCode::TestingDirective
1282-
| RejectCode::ReorgNotAllowed => {
1275+
| RejectCode::TestingDirective => {
12831276
// No additional data to serialize / deserialize
12841277
}
12851278
};
@@ -1305,7 +1298,6 @@ impl StacksMessageCodec for RejectCode {
13051298
RejectCodeTypePrefix::NoSortitionView => RejectCode::NoSortitionView,
13061299
RejectCodeTypePrefix::SortitionViewMismatch => RejectCode::SortitionViewMismatch,
13071300
RejectCodeTypePrefix::TestingDirective => RejectCode::TestingDirective,
1308-
RejectCodeTypePrefix::ReorgNotAllowed => RejectCode::ReorgNotAllowed,
13091301
};
13101302
Ok(code)
13111303
}
@@ -1397,9 +1389,6 @@ impl std::fmt::Display for RejectCode {
13971389
RejectCode::TestingDirective => {
13981390
write!(f, "The block was rejected due to a testing directive.")
13991391
}
1400-
RejectCode::ReorgNotAllowed => {
1401-
write!(f, "The block was rejected due to an invalid reorg attempt.")
1402-
}
14031392
}
14041393
}
14051394
}

testnet/stacks-node/src/tests/signer/v0.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10320,7 +10320,7 @@ fn disallow_reorg_within_first_proposal_burn_block_timing_secs_but_more_than_one
1032010320
30,
1032110321
proposed_block.header.signer_signature_hash(),
1032210322
num_signers,
10323-
RejectCode::ReorgNotAllowed,
10323+
RejectCode::SortitionViewMismatch,
1032410324
)
1032510325
.expect("Timed out waiting for a block proposal to be rejected due to invalid reorg");
1032610326

0 commit comments

Comments
 (0)