Skip to content

Commit 23b7b44

Browse files
committed
Merge branch 'develop' into feat/resend-proposal
2 parents 82b9b68 + acd148a commit 23b7b44

File tree

13 files changed

+64
-47
lines changed

13 files changed

+64
-47
lines changed

.github/workflows/clarity-js-sdk-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
steps:
2929
- name: Checkout latest clarity js sdk
3030
id: git_checkout
31-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
31+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3232
with:
3333
token: ${{ secrets.GH_TOKEN }}
3434
repository: ${{ env.CLARITY_JS_SDK_REPOSITORY }}
@@ -46,7 +46,7 @@ jobs:
4646

4747
- name: Create Pull Request
4848
id: create_pr
49-
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
49+
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
5050
with:
5151
token: ${{ secrets.GH_TOKEN }}
5252
commit-message: "chore: update clarity-native-bin tag"

.github/workflows/clippy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222
steps:
2323
- name: Checkout the latest code
2424
id: git_checkout
25-
uses: actions/checkout@v3
25+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2626
- name: Define Rust Toolchain
2727
id: define_rust_toolchain
2828
run: echo "RUST_TOOLCHAIN=$(cat ./rust-toolchain)" >> $GITHUB_ENV
2929
- name: Setup Rust Toolchain
3030
id: setup_rust_toolchain
31-
uses: actions-rust-lang/setup-rust-toolchain@v1
31+
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
3232
with:
3333
toolchain: ${{ env.RUST_TOOLCHAIN }}
3434
components: clippy

.github/workflows/core-build-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
steps:
1313
- name: Checkout the latest code
1414
id: git_checkout
15-
uses: actions/checkout@v3
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1616
- name: Define Rust Toolchain
1717
id: define_rust_toolchain
1818
run: echo "RUST_TOOLCHAIN=$(cat ./rust-toolchain)" >> $GITHUB_ENV
1919
- name: Setup Rust Toolchain
2020
id: setup_rust_toolchain
21-
uses: actions-rust-lang/setup-rust-toolchain@v1
21+
uses: actions-rust-lang/setup-rust-toolchain@11df97af8e8102fd60b60a77dfbf58d40cd843b8 # v1.10.1
2222
with:
2323
toolchain: ${{ env.RUST_TOOLCHAIN }}
2424
- name: Build the binaries

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ jobs:
2121
image:
2222
name: Build Image
2323
runs-on: ubuntu-latest
24-
strategy:
25-
fail-fast: false
26-
## Build a maximum of 2 images concurrently based on matrix.dist
27-
max-parallel: 2
28-
matrix:
29-
dist:
30-
- debian
3124
steps:
3225
## Setup Docker for the builds
3326
- name: Docker setup
@@ -49,7 +42,7 @@ jobs:
4942
## Set docker metatdata
5043
- name: Docker Metadata ( ${{matrix.dist}} )
5144
id: docker_metadata
52-
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 #v5.5.1
45+
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 #v5.6.1
5346
with:
5447
images: |
5548
${{env.docker-org}}/${{ github.event.repository.name }}
@@ -61,9 +54,9 @@ jobs:
6154
## Build docker image
6255
- name: Build and Push ( ${{matrix.dist}} )
6356
id: docker_build
64-
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
57+
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
6558
with:
66-
file: ./.github/actions/dockerfiles/Dockerfile.${{matrix.dist}}-source
59+
file: ./Dockerfile
6760
platforms: ${{ env.docker_platforms }}
6861
tags: ${{ steps.docker_metadata.outputs.tags }}
6962
labels: ${{ steps.docker_metadata.outputs.labels }}

.github/workflows/stacks-core-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
## checkout the code
7979
- name: Checkout the latest code
8080
id: git_checkout
81-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
81+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
8282

8383
- name: Run network relay tests
8484
id: nettest
@@ -96,10 +96,10 @@ jobs:
9696
steps:
9797
- name: Checkout the latest code
9898
id: git_checkout
99-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
99+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
100100
- name: Execute core contract unit tests with clarinet-sdk
101101
id: clarinet_unit_test
102-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
102+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
103103
with:
104104
node-version: 18.x
105105
cache: "npm"
@@ -125,7 +125,7 @@ jobs:
125125
steps:
126126
- name: Checkout the latest code
127127
id: git_checkout
128-
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
128+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
129129
- name: Execute core contract unit tests in Clarinet
130130
id: clarinet_unit_test_v1
131131
uses: docker://hirosystems/clarinet:1.7.1

CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [3.1.0.0.7]
11+
1012
## Added
1113

1214
- Add `disable_retries` mode for events_observer disabling automatic retry on error

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ COPY . .
1010

1111
RUN mkdir /out
1212

13+
RUN rustup toolchain install stable
1314
RUN cargo build --features monitoring_prom,slog_json --release
1415

1516
RUN cp target/release/stacks-node /out

clarity/src/vm/contexts.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,11 @@ impl<'a, 'hooks> OwnedEnvironment<'a, 'hooks> {
799799
self.context.cost_track.get_total()
800800
}
801801

802+
#[cfg(any(test, feature = "testing"))]
803+
pub fn mut_cost_tracker(&mut self) -> &mut LimitedCostTracker {
804+
&mut self.context.cost_track
805+
}
806+
802807
/// Destroys this environment, returning ownership of its database reference.
803808
/// If the context wasn't top-level (i.e., it had uncommitted data), return None,
804809
/// because the database is not guaranteed to be in a sane state.

clarity/src/vm/costs/mod.rs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use crate::vm::types::Value::UInt;
3838
use crate::vm::types::{
3939
FunctionType, PrincipalData, QualifiedContractIdentifier, TupleData, TypeSignature,
4040
};
41-
use crate::vm::{eval_all, ClarityName, SymbolicExpression, Value};
41+
use crate::vm::{CallStack, ClarityName, Environment, LocalContext, SymbolicExpression, Value};
4242

4343
pub mod constants;
4444
pub mod cost_functions;
@@ -331,7 +331,7 @@ pub struct TrackerData {
331331
/// if the cost tracker is non-free, this holds the StacksEpochId that should be used to evaluate
332332
/// the Clarity cost functions. If the tracker *is* free, then those functions do not need to be
333333
/// evaluated, so no epoch identifier is necessary.
334-
epoch: StacksEpochId,
334+
pub epoch: StacksEpochId,
335335
mainnet: bool,
336336
chain_id: u32,
337337
}
@@ -1053,8 +1053,8 @@ pub fn parse_cost(
10531053

10541054
// TODO: add tests from mutation testing results #4832
10551055
#[cfg_attr(test, mutants::skip)]
1056-
fn compute_cost(
1057-
cost_tracker: &mut TrackerData,
1056+
pub fn compute_cost(
1057+
cost_tracker: &TrackerData,
10581058
cost_function_reference: ClarityCostFunctionReference,
10591059
input_sizes: &[u64],
10601060
eval_in_epoch: StacksEpochId,
@@ -1073,7 +1073,7 @@ fn compute_cost(
10731073

10741074
let cost_contract = cost_tracker
10751075
.cost_contracts
1076-
.get_mut(&cost_function_reference.contract_id)
1076+
.get(&cost_function_reference.contract_id)
10771077
.ok_or(CostErrors::CostComputationFailed(format!(
10781078
"CostFunction not found: {cost_function_reference}"
10791079
)))?;
@@ -1088,14 +1088,23 @@ fn compute_cost(
10881088
)));
10891089
}
10901090

1091-
let function_invocation = [SymbolicExpression::list(program)];
1091+
let function_invocation = SymbolicExpression::list(program);
1092+
let eval_result = global_context.execute(|global_context| {
1093+
let context = LocalContext::new();
1094+
let mut call_stack = CallStack::new();
1095+
let publisher: PrincipalData = cost_contract.contract_identifier.issuer.clone().into();
1096+
let mut env = Environment::new(
1097+
global_context,
1098+
cost_contract,
1099+
&mut call_stack,
1100+
Some(publisher.clone()),
1101+
Some(publisher.clone()),
1102+
None,
1103+
);
10921104

1093-
let eval_result = eval_all(
1094-
&function_invocation,
1095-
cost_contract,
1096-
&mut global_context,
1097-
None,
1098-
);
1105+
let result = super::eval(&function_invocation, &mut env, &context)?;
1106+
Ok(Some(result))
1107+
});
10991108

11001109
parse_cost(&cost_function_reference.to_string(), eval_result)
11011110
}

stacks-signer/CHANGELOG.md

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

88
## [Unreleased]
99

10+
## [3.1.0.0.7.0]
11+
1012
## Changed
1113

1214
- Add new reject codes to the signer response for better visibility into why a block was rejected.

0 commit comments

Comments
 (0)