Skip to content

Commit b133a2a

Browse files
authored
Merge branch 'develop' into chore/add-http-traffic-heartbeat-log
2 parents aedc3b1 + a58ac52 commit b133a2a

File tree

9 files changed

+38
-21
lines changed

9 files changed

+38
-21
lines changed

.github/workflows/github-release.yml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ concurrency:
3838
run-name: ${{ inputs.node_tag || inputs.signer_tag }}
3939

4040
jobs:
41+
## This job's sole purpose is trigger a secondary approval outside of the matrix jobs below.
42+
## - If this job isn't approved to run, then the subsequent jobs will also not run - for this reason, we always exit 0
43+
## - `andon-cord` requires the repo environment "Build Release", which will trigger a secondary approval step before running this workflow.
44+
andon-cord:
45+
if: |
46+
inputs.node_tag != '' ||
47+
inputs.signer_tag != ''
48+
name: Andon Cord
49+
runs-on: ubuntu-latest
50+
environment: "Build Release"
51+
steps:
52+
- name: Check Approval
53+
id: check
54+
run: |
55+
exit 0
4156
## Build arch dependent binaries from source
4257
##
4358
## Runs when the following is true:
@@ -48,7 +63,8 @@ jobs:
4863
inputs.signer_tag != ''
4964
name: Build Binaries
5065
runs-on: ubuntu-latest
51-
environment: "Build Release"
66+
needs:
67+
- andon-cord
5268
strategy:
5369
## Run a maximum of 10 builds concurrently, using the matrix defined in inputs.arch
5470
max-parallel: 10
@@ -91,6 +107,7 @@ jobs:
91107
name: Create Release
92108
runs-on: ubuntu-latest
93109
needs:
110+
- andon-cord
94111
- build-binaries
95112
permissions:
96113
contents: write
@@ -107,7 +124,6 @@ jobs:
107124
is_signer_release: ${{ inputs.is_signer_release }}
108125
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109126

110-
111127
## Builds arch dependent Docker images from binaries
112128
##
113129
## Note: this step requires the binaries in the create-release step to be uploaded
@@ -120,6 +136,7 @@ jobs:
120136
name: Docker Image (Binary)
121137
runs-on: ubuntu-latest
122138
needs:
139+
- andon-cord
123140
- build-binaries
124141
- create-release
125142
strategy:
@@ -152,6 +169,7 @@ jobs:
152169
name: Create Downstream PR (${{ github.ref_name }})
153170
runs-on: ubuntu-latest
154171
needs:
172+
- andon-cord
155173
- build-binaries
156174
- create-release
157175
- docker-image

.github/workflows/image-build-source.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
image:
2222
name: Build Image
2323
runs-on: ubuntu-latest
24+
## Requires the repo environment "Push to Docker", which will trigger a secondary approval step before running this workflow.
25+
environment: "Push to Docker"
2426
steps:
2527
## Setup Docker for the builds
2628
- name: Docker setup

contrib/tools/block-replay.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ start_replay() {
195195
starting_block=0 # for the block counter, start at this block
196196
## use these values if `--testing` arg is provided (only replay 1_000 blocks) Note: 2.5 epoch is at 153106
197197
${TESTING} && total_blocks=153000
198-
${TESTING} && starting_block=15200
198+
${TESTING} && starting_block=152000
199199
;;
200200
esac
201201
local block_diff=$((total_blocks - starting_block)) ## how many blocks are being replayed

pox-locking/src/pox_2.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ pub fn parse_pox_increase(result: &Value) -> std::result::Result<(PrincipalData,
173173
///
174174
/// # Errors
175175
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
176-
/// which isn't locked. This *should* have been checked by the PoX v2 contract,
177-
/// so this should surface in a panic.
176+
/// which isn't locked. This *should* have been checked by the PoX v2 contract,
177+
/// so this should surface in a panic.
178178
pub fn pox_lock_increase_v2(
179179
db: &mut ClarityDatabase,
180180
principal: &PrincipalData,
@@ -226,8 +226,8 @@ pub fn pox_lock_increase_v2(
226226
///
227227
/// # Errors
228228
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
229-
/// which isn't locked. This *should* have been checked by the PoX v2 contract,
230-
/// so this should surface in a panic.
229+
/// which isn't locked. This *should* have been checked by the PoX v2 contract,
230+
/// so this should surface in a panic.
231231
pub fn pox_lock_extend_v2(
232232
db: &mut ClarityDatabase,
233233
principal: &PrincipalData,

pox-locking/src/pox_3.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ pub fn pox_lock_v3(
9696
///
9797
/// # Errors
9898
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
99-
/// which isn't locked. This *should* have been checked by the PoX v3 contract,
100-
/// so this should surface in a panic.
99+
/// which isn't locked. This *should* have been checked by the PoX v3 contract,
100+
/// so this should surface in a panic.
101101
pub fn pox_lock_extend_v3(
102102
db: &mut ClarityDatabase,
103103
principal: &PrincipalData,
@@ -132,8 +132,8 @@ pub fn pox_lock_extend_v3(
132132
///
133133
/// # Errors
134134
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
135-
/// which isn't locked. This *should* have been checked by the PoX v3 contract,
136-
/// so this should surface in a panic.
135+
/// which isn't locked. This *should* have been checked by the PoX v3 contract,
136+
/// so this should surface in a panic.
137137
pub fn pox_lock_increase_v3(
138138
db: &mut ClarityDatabase,
139139
principal: &PrincipalData,

pox-locking/src/pox_4.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ pub fn pox_lock_v4(
6969
///
7070
/// # Errors
7171
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
72-
/// which isn't locked. This *should* have been checked by the PoX v4 contract,
73-
/// so this should surface in a panic.
72+
/// which isn't locked. This *should* have been checked by the PoX v4 contract,
73+
/// so this should surface in a panic.
7474
pub fn pox_lock_extend_v4(
7575
db: &mut ClarityDatabase,
7676
principal: &PrincipalData,
@@ -105,8 +105,8 @@ pub fn pox_lock_extend_v4(
105105
///
106106
/// # Errors
107107
/// - Returns Error::PoxExtendNotLocked if this function was called on an account
108-
/// which isn't locked. This *should* have been checked by the PoX v4 contract,
109-
/// so this should surface in a panic.
108+
/// which isn't locked. This *should* have been checked by the PoX v4 contract,
109+
/// so this should surface in a panic.
110110
pub fn pox_lock_increase_v4(
111111
db: &mut ClarityDatabase,
112112
principal: &PrincipalData,

stacks-common/src/deps_common/bitcoin/blockdata/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl BlockHeader {
101101

102102
/// Computes the target value in float format from Uint256 format.
103103
pub fn compact_target_from_u256(value: &Uint256) -> u32 {
104-
let mut size = (value.bits() + 7) / 8;
104+
let mut size = value.bits().div_ceil(8);
105105
let mut compact = if size <= 3 {
106106
(value.low_u64() << (8 * (3 - size))) as u32
107107
} else {

stacks-common/src/deps_common/bitcoin/util/hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ pub fn bitcoin_merkle_root(data: Vec<Sha256dHash>) -> Sha256dHash {
436436
return data[0];
437437
}
438438
// Recursion
439-
let iterations = (data.len() + 1) / 2;
439+
let iterations = data.len().div_ceil(2);
440440
let mut next = Vec::with_capacity(iterations);
441441
for idx in 0..iterations {
442442
let idx1 = 2 * idx;

stacks-common/src/util/secp256k1/native.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,7 @@ impl MessageSignature {
9494
let mut sig_bytes = [0u8; 64];
9595
sig_bytes[..64].copy_from_slice(&self.0[1..=64]);
9696

97-
match LibSecp256k1RecoverableSignature::from_compact(&sig_bytes, recid) {
98-
Ok(sig) => Some(sig),
99-
Err(_) => None,
100-
}
97+
LibSecp256k1RecoverableSignature::from_compact(&sig_bytes, recid).ok()
10198
}
10299

103100
/// Convert from VRS to RSV

0 commit comments

Comments
 (0)