Skip to content

Commit 4273af8

Browse files
authored
Merge branch 'develop' into large-mempool-flakiness
2 parents a37b478 + 3a434da commit 4273af8

File tree

11 files changed

+105
-70
lines changed

11 files changed

+105
-70
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -102,22 +102,6 @@ jobs:
102102
signer_docker_tag: ${{ needs.check-release.outputs.signer_docker_tag }}
103103
is_node_release: ${{ needs.check-release.outputs.is_node_release }}
104104
is_signer_release: ${{ needs.check-release.outputs.is_signer_release }}
105-
secrets: inherit
106-
107-
## Build and push Debian image built from source
108-
##
109-
## Runs when:
110-
## - it is not a node or signer-only release run
111-
docker-image:
112-
if: |
113-
needs.check-release.outputs.is_node_release != 'true' ||
114-
needs.check-release.outputs.is_signer_release != 'true'
115-
name: Docker Image (Source)
116-
uses: ./.github/workflows/image-build-source.yml
117-
needs:
118-
- rustfmt
119-
- check-release
120-
secrets: inherit
121105

122106
## Create a reusable cache for tests
123107
##

.github/workflows/github-release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ on:
2929
description: "True if it is a signer release"
3030
required: true
3131
type: string
32-
secrets:
33-
GH_TOKEN:
34-
required: true
3532

3633
concurrency:
3734
group: github-release-${{ github.head_ref || github.ref }}
@@ -95,6 +92,8 @@ jobs:
9592
runs-on: ubuntu-latest
9693
needs:
9794
- build-binaries
95+
permissions:
96+
contents: write
9897
steps:
9998
## Creates releases
10099
- name: Create Release
@@ -106,7 +105,7 @@ jobs:
106105
signer_docker_tag: ${{ inputs.signer_docker_tag }}
107106
is_node_release: ${{ inputs.is_node_release }}
108107
is_signer_release: ${{ inputs.is_signer_release }}
109-
GH_TOKEN: ${{ secrets.GH_TOKEN }}
108+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110109

111110

112111
## Builds arch dependent Docker images from binaries
@@ -156,9 +155,11 @@ jobs:
156155
- build-binaries
157156
- create-release
158157
- docker-image
158+
permissions:
159+
pull-requests: write
159160
steps:
160161
- name: Open Downstream PR
161162
id: create-pr
162163
uses: stacks-network/actions/stacks-core/release/downstream-pr@main
163164
with:
164-
token: ${{ secrets.GH_TOKEN }}
165+
token: ${{ secrets.GITHUB_TOKEN }}

Cargo.lock

Lines changed: 2 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

libsigner/Cargo.toml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,8 @@ hashbrown = { workspace = true }
2121
lazy_static = "1.4.0"
2222
libc = "0.2"
2323
libstackerdb = { path = "../libstackerdb" }
24-
prometheus = { version = "0.9", optional = true }
2524
serde = "1"
26-
serde_derive = "1"
27-
serde_stacker = "0.1"
2825
slog = { version = "2.5.2", features = [ "max_level_trace" ] }
29-
slog-term = "2.6.0"
30-
slog-json = { version = "2.3.0", optional = true }
3126
stacks-common = { path = "../stacks-common" }
3227
stackslib = { path = "../stackslib"}
3328
thiserror = { workspace = true }
@@ -42,15 +37,8 @@ rand = { workspace = true }
4237
version = "1.0"
4338
features = ["arbitrary_precision", "unbounded_depth"]
4439

45-
[dependencies.secp256k1]
46-
version = "0.24.3"
47-
features = ["serde", "recovery"]
48-
4940
[target.'cfg(all(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"), not(any(target_os="windows"))))'.dependencies]
5041
sha2 = { version = "0.10", features = ["asm"] }
5142

5243
[target.'cfg(any(not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64")), any(target_os = "windows")))'.dependencies]
5344
sha2 = { version = "0.10" }
54-
55-
[features]
56-
monitoring_prom = ["prometheus"]

libstackerdb/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ path = "./src/libstackerdb.rs"
1717

1818
[dependencies]
1919
serde = "1"
20-
serde_derive = "1"
21-
serde_stacker = "0.1"
2220
stacks-common = { path = "../stacks-common" }
2321
clarity = { path = "../clarity" }
2422

stacks-signer/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ prometheus = { version = "0.9", optional = true }
3131
rand_core = "0.6"
3232
reqwest = { version = "0.11.22", default-features = false, features = ["blocking", "json", "rustls-tls"] }
3333
serde = "1"
34-
serde_derive = "1"
35-
serde_stacker = "0.1"
3634
slog = { version = "2.5.2", features = [ "max_level_trace" ] }
3735
slog-json = { version = "2.3.0", optional = true }
3836
slog-term = "2.6.0"
@@ -62,5 +60,5 @@ features = ["serde", "recovery"]
6260

6361
[features]
6462
default = []
65-
monitoring_prom = ["libsigner/monitoring_prom", "prometheus", "tiny_http"]
63+
monitoring_prom = ["prometheus", "tiny_http"]
6664
testing = []

stackslib/Cargo.toml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,15 @@ rand_core = { workspace = true }
3636
rand_chacha = { workspace = true }
3737
serde = "1"
3838
serde_derive = "1"
39-
serde_stacker = "0.1"
40-
sha3 = "0.10.1"
4139
ripemd = "0.1.1"
4240
regex = "1"
4341
mio = "0.6"
4442
lazy_static = "1.4.0"
4543
url = "2.1.0"
4644
percent-encoding = "2.1.0"
4745
prometheus = { version = "0.9", optional = true }
48-
integer-sqrt = "0.1.3"
4946
slog = { version = "2.5.2", features = [ "max_level_trace" ] }
50-
slog-term = "2.6.0"
51-
slog-json = { version = "2.3.0", optional = true }
52-
chrono = "0.4.19"
53-
libc = "0.2.82"
47+
chrono = { version = "0.4.19", optional = true }
5448
clarity = { path = "../clarity" }
5549
stacks-common = { path = "../stacks-common" }
5650
pox-locking = { path = "../pox-locking" }
@@ -97,15 +91,16 @@ rstest = "0.17.0"
9791
rstest_reuse = "0.5.0"
9892
mutants = "0.0.3"
9993
rlimit = "0.10.2"
94+
chrono = "0.4.19"
10095

10196
[features]
10297
default = []
10398
profile-sqlite = []
10499
disable-costs = []
105100
developer-mode = ["clarity/developer-mode"]
106101
monitoring_prom = ["prometheus"]
107-
slog_json = ["slog-json", "stacks-common/slog_json", "clarity/slog_json", "pox-locking/slog_json"]
108-
testing = []
102+
slog_json = ["stacks-common/slog_json", "clarity/slog_json", "pox-locking/slog_json"]
103+
testing = ["chrono"]
109104

110105
[target.'cfg(all(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"), not(any(target_os="windows"))))'.dependencies]
111106
sha2 = { version = "0.10", features = ["asm"] }

stackslib/src/config/chain_data.rs

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,7 @@ pub mod tests {
722722
}
723723

724724
#[test]
725+
#[cfg(unix)]
725726
fn test_get_unconfirmed_commits() {
726727
use std::os::unix::fs::PermissionsExt;
727728
let shell_code = r#"#!/bin/bash
@@ -808,6 +809,87 @@ EOF
808809
);
809810
}
810811

812+
#[test]
813+
#[cfg(windows)]
814+
fn test_get_unconfirmed_commits() {
815+
let shell_code = r#"@echo off
816+
(
817+
echo [
818+
echo {
819+
echo "txid": "73c318be8cd272a73200b9630089d77a44342d84b2c0d81c937da714152cf402",
820+
echo "burn": 555000,
821+
echo "address": "1FCcoFSKWvNyhjazNvVdLLw8mGkGdcRMux",
822+
echo "input_txid": "ef0dbf0fc4755de5e94843a4da7c1d943571299afb15f32b76bac5d18d8668ce",
823+
echo "input_index": 3,
824+
echo "pox_addrs": [
825+
echo "0014db14133a9dbb1d0e16b60513453e48b6ff2847a9",
826+
echo "a91418c42080a1e87fd02dd3fca94c4513f9ecfe741487"
827+
echo ]
828+
echo }
829+
echo ]
830+
)
831+
"#;
832+
let path = "/tmp/test-get-unconfirmed-commits.bat";
833+
if fs::metadata(path).is_ok() {
834+
fs::remove_file(path).unwrap();
835+
}
836+
{
837+
let mut f = fs::File::create(path).unwrap();
838+
f.write_all(shell_code.as_bytes()).unwrap();
839+
}
840+
841+
let ms = MinerStats {
842+
unconfirmed_commits_helper: path.to_string(),
843+
};
844+
845+
let mut commits = ms.get_unconfirmed_commits(123, &[]).unwrap();
846+
assert_eq!(commits.len(), 1);
847+
let commit = commits.pop().unwrap();
848+
849+
assert_eq!(
850+
commit.txid,
851+
Txid::from_hex("73c318be8cd272a73200b9630089d77a44342d84b2c0d81c937da714152cf402")
852+
.unwrap()
853+
);
854+
assert_eq!(commit.burn_fee, 555000);
855+
assert_eq!(
856+
commit.apparent_sender.0,
857+
"1FCcoFSKWvNyhjazNvVdLLw8mGkGdcRMux".to_string()
858+
);
859+
assert_eq!(
860+
commit.input.0,
861+
Txid::from_hex("ef0dbf0fc4755de5e94843a4da7c1d943571299afb15f32b76bac5d18d8668ce")
862+
.unwrap()
863+
);
864+
assert_eq!(commit.input.1, 3);
865+
assert_eq!(commit.block_height, 123);
866+
867+
assert_eq!(
868+
commit.commit_outs,
869+
vec![
870+
PoxAddress::Addr20(
871+
true,
872+
PoxAddressType20::P2WPKH,
873+
[
874+
219, 20, 19, 58, 157, 187, 29, 14, 22, 182, 5, 19, 69, 62, 72, 182, 255,
875+
40, 71, 169
876+
]
877+
),
878+
PoxAddress::Standard(
879+
StacksAddress::new(
880+
20,
881+
Hash160([
882+
0x18, 0xc4, 0x20, 0x80, 0xa1, 0xe8, 0x7f, 0xd0, 0x2d, 0xd3, 0xfc, 0xa9,
883+
0x4c, 0x45, 0x13, 0xf9, 0xec, 0xfe, 0x74, 0x14
884+
])
885+
)
886+
.unwrap(),
887+
None
888+
)
889+
]
890+
);
891+
}
892+
811893
#[test]
812894
fn test_get_spend_and_win_distribution() {
813895
let active_miners_and_commits = vec![

stackslib/src/net/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2883,9 +2883,10 @@ pub mod test {
28832883
pub fn test_path(config: &TestPeerConfig) -> String {
28842884
let random = thread_rng().gen::<u64>();
28852885
let random_bytes = to_hex(&random.to_be_bytes());
2886+
let cleaned_config_test_name = config.test_name.replace("::", "_");
28862887
format!(
28872888
"/tmp/stacks-node-tests/units-test-peer/{}-{}",
2888-
&config.test_name, random_bytes
2889+
&cleaned_config_test_name, random_bytes
28892890
)
28902891
}
28912892

stackslib/src/net/tests/convergence.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,28 @@ use std::collections::{HashMap, HashSet};
2121
use clarity::vm::types::{QualifiedContractIdentifier, StandardPrincipalData};
2222
use rand::prelude::*;
2323
use rand::thread_rng;
24-
use rlimit;
2524

2625
use crate::core::PEER_VERSION_TESTNET;
2726
use crate::net::db::*;
2827
use crate::net::test::*;
2928
use crate::net::*;
3029
use crate::util_lib::test::*;
3130

31+
#[cfg(unix)]
3232
fn setup_rlimit_nofiles() {
33+
use rlimit;
3334
info!("Attempt to set nofile rlimit to 4096 (required for these tests to run)");
3435
assert!(rlimit::Resource::NOFILE.get().is_ok());
3536
let (slimit, hlimit) = rlimit::getrlimit(rlimit::Resource::NOFILE).unwrap();
3637
rlimit::setrlimit(rlimit::Resource::NOFILE, 4096.max(slimit), hlimit).unwrap();
3738
info!("Successfully set nofile rlimit to 4096");
3839
}
3940

41+
#[cfg(windows)]
42+
fn setup_rlimit_nofiles() {
43+
// rlimit empty stub, since windows hasn't a hard file descriptor limit
44+
}
45+
4046
fn stacker_db_id(i: usize) -> QualifiedContractIdentifier {
4147
QualifiedContractIdentifier::new(
4248
StandardPrincipalData::new(0x01, [i as u8; 20]).unwrap(),

0 commit comments

Comments
 (0)