Skip to content

Commit a3a55ce

Browse files
authored
Merge branch 'develop' into refactor/wasm-target-conditional-compilation
2 parents 4777e51 + 9a4f412 commit a3a55ce

File tree

18 files changed

+441
-25
lines changed

18 files changed

+441
-25
lines changed

.cargo/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ clippy-stacks = "clippy -p libstackerdb -p stacks-signer -p pox-locking -p clari
1212
#[target.x86_64-unknown-linux-gnu]
1313
#linker = "/usr/bin/clang"
1414
#rustflags = ["-Clink-arg=-fuse-ld=lld", "-Clink-arg=-Wl,--no-rosegment"]
15-

.rustfmt.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
group_imports = "StdExternalCrate"
2+
imports_granularity = "Module"

.vscode/settings.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
2-
"lldb.adapterType": "native",
3-
"lldb.launch.sourceLanguages": ["rust"],
2+
"lldb.launch.sourceLanguages": [
3+
"rust"
4+
],
45
"rust-analyzer.runnables.extraEnv": {
56
"BITCOIND_TEST": "1"
6-
}
7+
},
8+
"rust-analyzer.rustfmt.extraArgs": [
9+
"+nightly"
10+
]
711
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
77

88
## [Unreleased]
99

10+
### Added"
11+
- Add fee information to transaction log ending with "success" or "skipped", while building a new block
12+
1013
### Changed
1114

1215
- When a miner times out waiting for signatures, it will re-propose the same block instead of building a new block ([#5877](https://github.com/stacks-network/stacks-core/pull/5877))
16+
- Improve tenure downloader trace verbosity applying proper logging level depending on the tenure state ("debug" if unconfirmed, "info" otherwise) ([#5871](https://github.com/stacks-network/stacks-core/issues/5871))
1317

1418
## [3.1.0.0.7]
1519

contrib/nix/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# `nix` flake
2+
3+
Build `stacks-node` and `stacks-signer` by pointing to the `flake.nix` file in
4+
this directory. For instance, from the root directory: `nix build
5+
'./contrib/nix'`.
6+
7+
## Installing `nix`
8+
9+
Follow the [official documentation](https://nix.dev/install-nix) or use the
10+
[Determinate Nix Installer](https://github.com/DeterminateSystems/nix-installer).
11+
12+
## Using `direnv`
13+
14+
If using `direnv`, from the root directory of this repository:
15+
16+
```bash
17+
echo "use flake ./contrib/nix/" > .envrc
18+
direnv allow
19+
```
20+
21+
This will provide a `sh` environment with required dependencies (e.g., `bitcoind`) available.

contrib/nix/flake.lock

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

contrib/nix/flake.nix

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
{
2+
description = "stacks-core";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6+
systems.url = "github:nix-systems/default";
7+
8+
flake-utils = {
9+
url = "github:numtide/flake-utils";
10+
inputs.systems.follows = "systems";
11+
};
12+
13+
rust-overlay = {
14+
url = "github:oxalica/rust-overlay";
15+
inputs.nixpkgs.follows = "nixpkgs";
16+
};
17+
18+
crane = {
19+
url = "github:ipetkov/crane";
20+
};
21+
22+
};
23+
24+
outputs =
25+
{
26+
nixpkgs,
27+
flake-utils,
28+
rust-overlay,
29+
crane,
30+
...
31+
}:
32+
flake-utils.lib.eachDefaultSystem (
33+
system:
34+
let
35+
overlays = [ (import rust-overlay) ];
36+
pkgs = import nixpkgs {
37+
inherit system overlays;
38+
};
39+
40+
inherit (pkgs) lib;
41+
42+
toolchain = pkgs.rust-bin.fromRustupToolchainFile ../../rust-toolchain;
43+
craneLib = (crane.mkLib pkgs).overrideToolchain toolchain;
44+
45+
name = "stacks-core";
46+
47+
versions = (builtins.fromTOML (builtins.readFile ../../versions.toml));
48+
version = versions.stacks_node_version;
49+
50+
# Common arguments can be set here to avoid repeating them later
51+
commonArgs = {
52+
strictDeps = true;
53+
54+
buildInputs =
55+
[
56+
# Add additional build inputs here
57+
]
58+
++ lib.optionals pkgs.stdenv.isDarwin [
59+
# Darwin specific inputs
60+
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
61+
];
62+
};
63+
64+
# Build *just* the cargo dependencies, so we can reuse
65+
# all of that work (e.g. via cachix) when running in CI
66+
cargoArtifacts = craneLib.buildDepsOnly (
67+
commonArgs
68+
// {
69+
inherit version;
70+
pname = name;
71+
src = fileSetForCrate ../..;
72+
}
73+
);
74+
75+
individualCrateArgs = commonArgs // {
76+
inherit cargoArtifacts;
77+
78+
# NB: we disable tests since we'll run them all via cargo-nextest
79+
doCheck = false;
80+
};
81+
82+
# TODO: Return minimum fileSets per each crate
83+
fileSetForCrate =
84+
crate:
85+
lib.fileset.toSource {
86+
root = ../..;
87+
fileset = lib.fileset.unions [
88+
../../Cargo.toml
89+
../../Cargo.lock
90+
#
91+
../../versions.toml
92+
#
93+
../../stx-genesis/name_zonefiles.txt
94+
../../stx-genesis/name_zonefiles.txt.sha256
95+
../../stx-genesis/name_zonefiles-test.txt
96+
../../stx-genesis/name_zonefiles-test.txt.sha256
97+
../../stx-genesis/chainstate.txt
98+
../../stx-genesis/chainstate.txt.sha256
99+
../../stx-genesis/chainstate-test.txt
100+
../../stx-genesis/chainstate-test.txt.sha256
101+
#
102+
(craneLib.fileset.commonCargoSources crate)
103+
#
104+
(lib.fileset.fileFilter (file: file.hasExt "clar") ../..)
105+
#
106+
(craneLib.fileset.commonCargoSources ../../clarity)
107+
(craneLib.fileset.commonCargoSources ../../contrib/tools/relay-server)
108+
(craneLib.fileset.commonCargoSources ../../libsigner)
109+
(craneLib.fileset.commonCargoSources ../../libstackerdb)
110+
(craneLib.fileset.commonCargoSources ../../pox-locking)
111+
(craneLib.fileset.commonCargoSources ../../stacks-common)
112+
(craneLib.fileset.commonCargoSources ../../stackslib)
113+
(craneLib.fileset.commonCargoSources ../../stx-genesis)
114+
(craneLib.fileset.commonCargoSources ../../testnet/stacks-node)
115+
];
116+
};
117+
118+
stacks-signer = craneLib.buildPackage (
119+
individualCrateArgs
120+
// rec {
121+
version = versions.stacks_signer_version;
122+
pname = "stacks-signer";
123+
cargoFeatures = "--features monitoring_prom";
124+
cargoExtraArgs = "${cargoFeatures} -p ${pname}";
125+
src = fileSetForCrate ../../stacks-signer;
126+
}
127+
);
128+
129+
# Build the actual crate itself, reusing the dependency
130+
# artifacts from above.
131+
stacks-core = craneLib.buildPackage (
132+
commonArgs
133+
// rec {
134+
inherit version cargoArtifacts;
135+
doCheck = false;
136+
pname = name;
137+
cargoFeatures = "--features monitoring_prom,slog_json";
138+
cargoExtraArgs = "${cargoFeatures}";
139+
src = fileSetForCrate ../..;
140+
}
141+
);
142+
in
143+
with pkgs;
144+
{
145+
packages = {
146+
inherit stacks-signer;
147+
default = stacks-core;
148+
};
149+
150+
apps = rec {
151+
stacks-node = {
152+
type = "app";
153+
program = "${stacks-core}/bin/stacks-node";
154+
};
155+
stacks-signer = {
156+
type = "app";
157+
program = "${stacks-signer}/bin/stacks-signer";
158+
};
159+
default = stacks-node;
160+
};
161+
162+
checks = {
163+
inherit stacks-core;
164+
};
165+
166+
devShells.default = craneLib.devShell {
167+
RUSTFMT = "${toolchain}/bin/rustfmt";
168+
GREETING = "Welcome, stacks-core developer!";
169+
shellHook = ''
170+
echo $GREETING
171+
172+
echo "Setting a few options that will help you when running tests:"
173+
set -x
174+
ulimit -n 10240
175+
set +x
176+
'';
177+
178+
packages =
179+
[
180+
rust-analyzer
181+
bitcoind
182+
]
183+
++ lib.optionals pkgs.stdenv.isDarwin [
184+
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
185+
pkgs.darwin.apple_sdk.frameworks.CoreServices
186+
];
187+
};
188+
}
189+
);
190+
}

stackslib/src/chainstate/stacks/miner.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,11 @@ pub enum TransactionEvent {
418418
impl TransactionResult {
419419
/// Logs a queryable message for the case where `txid` has succeeded.
420420
pub fn log_transaction_success(tx: &StacksTransaction) {
421-
info!("Tx successfully processed.";
421+
info!("Tx successfully processed";
422422
"event_name" => %"transaction_result",
423423
"tx_id" => %tx.txid(),
424424
"event_type" => %"success",
425+
"fee" => tx.get_tx_fee()
425426
);
426427
}
427428

@@ -445,6 +446,7 @@ impl TransactionResult {
445446
"tx_id" => %tx.txid(),
446447
"event_type" => "skip",
447448
"reason" => %err,
449+
"fee" => tx.get_tx_fee()
448450
);
449451
}
450452

stackslib/src/net/api/tests/get_tenures_fork_info.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ fn make_preamble<T: Display, R: Display>(start: &T, stop: &R) -> HttpRequestPrea
3737
content_length: Some(0),
3838
keep_alive: false,
3939
headers: BTreeMap::new(),
40+
set_cookie: Vec::new(),
4041
}
4142
}
4243

stackslib/src/net/api/tests/getsigner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ fn make_preamble(query: &str) -> HttpRequestPreamble {
4141
content_length: Some(0),
4242
keep_alive: false,
4343
headers: BTreeMap::new(),
44+
set_cookie: Vec::new(),
4445
}
4546
}
4647

0 commit comments

Comments
 (0)