Skip to content

Commit

Permalink
Merge branch 'develop' into fix/burn-view
Browse files Browse the repository at this point in the history
  • Loading branch information
jcnelson committed Dec 20, 2024
2 parents 6b18429 + 0ee5d7c commit 1819f2a
Show file tree
Hide file tree
Showing 115 changed files with 2,421 additions and 2,119 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/bitcoin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ jobs:
- tests::signer::v0::signer_set_rollover
- tests::signer::v0::signing_in_0th_tenure_of_reward_cycle
- tests::signer::v0::continue_after_tenure_extend
- tests::signer::v0::tenure_extend_after_idle
- tests::signer::v0::tenure_extend_after_idle_signers
- tests::signer::v0::tenure_extend_after_idle_miner
- tests::signer::v0::tenure_extend_succeeds_after_rejected_attempt
- tests::signer::v0::stx_transfers_dont_effect_idle_timeout
- tests::signer::v0::idle_tenure_extend_active_mining
- tests::signer::v0::multiple_miners_with_custom_chain_id
Expand All @@ -131,6 +133,7 @@ jobs:
- tests::signer::v0::block_validation_response_timeout
- tests::signer::v0::tenure_extend_after_bad_commit
- tests::signer::v0::block_proposal_max_age_rejections
- tests::signer::v0::global_acceptance_depends_on_block_announcement
- tests::nakamoto_integrations::burn_ops_integration_test
- tests::nakamoto_integrations::check_block_heights
- tests::nakamoto_integrations::clarity_burn_state
Expand All @@ -141,6 +144,7 @@ jobs:
- tests::nakamoto_integrations::mock_mining
- tests::nakamoto_integrations::multiple_miners
- tests::nakamoto_integrations::follower_bootup_across_multiple_cycles
- tests::nakamoto_integrations::nakamoto_lockup_events
- tests::nakamoto_integrations::utxo_check_on_startup_panic
- tests::nakamoto_integrations::utxo_check_on_startup_recover
- tests::nakamoto_integrations::v3_signer_api_endpoint
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Perform Clippy checks - currently set to defaults
## https://github.com/rust-lang/rust-clippy#usage
## https://rust-lang.github.io/rust-clippy/master/index.html
##
name: Clippy Checks

# Only run when:
# - PRs are (re)opened against develop branch
on:
pull_request:
branches:
- develop
types:
- opened
- reopened
- synchronize

jobs:
clippy_check:
name: Clippy Check
runs-on: ubuntu-latest
steps:
- name: Checkout the latest code
id: git_checkout
uses: actions/checkout@v3
- name: Define Rust Toolchain
id: define_rust_toolchain
run: echo "RUST_TOOLCHAIN=$(cat ./rust-toolchain)" >> $GITHUB_ENV
- name: Setup Rust Toolchain
id: setup_rust_toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: clippy
- name: Clippy
id: clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -p libstackerdb -p stacks-signer -p pox-locking -p clarity -p libsigner --no-deps --tests --all-features -- -D warnings
8 changes: 4 additions & 4 deletions .github/workflows/p2p-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
- net::tests::convergence::test_walk_star_15_org_biased
- net::tests::convergence::test_walk_inbound_line_15
- net::api::tests::postblock_proposal::test_try_make_response
- net::server::tests::test_http_10_threads_getinfo
- net::server::tests::test_http_10_threads_getblock
- net::server::tests::test_http_too_many_clients
- net::server::tests::test_http_slow_client
- net::server::test::test_http_10_threads_getinfo
- net::server::test::test_http_10_threads_getblock
- net::server::test::test_http_too_many_clients
- net::server::test::test_http_slow_client
steps:
## Setup test environment
- name: Setup Test Environment
Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/stacks-core-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,6 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
# Full genesis test with code coverage
full-genesis:
name: Full Genesis Test
runs-on: ubuntu-latest
strategy:
## Continue with the test matrix even if we've had a failure
fail-fast: false
## Run a maximum of 2 concurrent tests from the test matrix
max-parallel: 2
matrix:
test-name:
- neon_integrations::bitcoind_integration_test
steps:
## Setup test environment
- name: Setup Test Environment
id: setup_tests
uses: stacks-network/actions/stacks-core/testenv@main
with:
genesis: true
btc-version: "25.0"

## Run test matrix using restored cache of archive file
## - Test will timeout after env.TEST_TIMEOUT minutes
- name: Run Tests
id: run_tests
timeout-minutes: ${{ fromJSON(env.TEST_TIMEOUT) }}
uses: stacks-network/actions/stacks-core/run-tests@main
with:
test-name: ${{ matrix.test-name }}
threads: 1
archive-file: ~/genesis_archive.tar.zst

## Upload code coverage file
- name: Code Coverage
id: codecov
uses: stacks-network/actions/codecov@main
with:
test-name: large_genesis
filename: ./lcov.info

- name: Status Output
run: |
echo "run_tests: ${{ steps.run_tests.outputs.status }}"
echo "codecov: ${{ steps.codecov.outputs.status }}"
- name: Check Failures
if: steps.run_tests.outputs.status == 'failure' || steps.codecov.outputs.status == 'failure'
run: exit 1

# Unit tests with code coverage
unit-tests:
name: Unit Tests
Expand Down Expand Up @@ -186,7 +137,6 @@ jobs:
runs-on: ubuntu-latest
if: always()
needs:
- full-genesis
- open-api-validation
- core-contracts-clarinet-test
steps:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ and this project adheres to the versioning scheme outlined in the [README.md](RE
## [Unreleased]

### Added
- Add `tenure_timeout_secs` to the miner for determining when a time-based tenure extend should be attempted.

### Changed

- Nodes will assume that all PoX anchor blocks exist by default, and stall initial block download indefinitely to await their arrival (#5502)

## [3.1.0.0.1]

### Added
Expand Down
30 changes: 18 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ rand = "0.8"
rand_chacha = "0.3.1"
tikv-jemallocator = "0.5.4"
rusqlite = { version = "0.31.0", features = ["blob", "serde_json", "i128_blob", "bundled", "trace"] }
thiserror = { version = "1.0.65" }
thiserror = "1.0.65"
toml = "0.5.6"

# Use a bit more than default optimization for
# dev builds to speed up test execution
Expand Down
8 changes: 4 additions & 4 deletions clarity/src/vm/analysis/analysis_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ impl<'a> AnalysisDatabase<'a> {
self.begin();
let result = f(self).or_else(|e| {
self.roll_back()
.map_err(|e| CheckErrors::Expects(format!("{e:?}")).into())?;
.map_err(|e| CheckErrors::Expects(format!("{e:?}")))?;
Err(e)
})?;
self.commit()
.map_err(|e| CheckErrors::Expects(format!("{e:?}")).into())?;
.map_err(|e| CheckErrors::Expects(format!("{e:?}")))?;
Ok(result)
}

Expand Down Expand Up @@ -130,9 +130,9 @@ impl<'a> AnalysisDatabase<'a> {
.map_err(|_| CheckErrors::Expects("Bad data deserialized from DB".into()))
})
.transpose()?
.and_then(|mut x| {
.map(|mut x| {
x.canonicalize_types(epoch);
Some(x)
x
}))
}

Expand Down
2 changes: 1 addition & 1 deletion clarity/src/vm/analysis/arithmetic_checker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl std::fmt::Display for Error {
}
}

impl<'a> ArithmeticOnlyChecker<'a> {
impl ArithmeticOnlyChecker<'_> {
pub fn check_contract_cost_eligible(contract_analysis: &mut ContractAnalysis) {
let is_eligible = ArithmeticOnlyChecker::run(contract_analysis).is_ok();
contract_analysis.is_cost_contract_eligible = is_eligible;
Expand Down
4 changes: 2 additions & 2 deletions clarity/src/vm/analysis/contract_interface_builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ impl ContractInterfaceFunction {
outputs: ContractInterfaceFunctionOutput {
type_f: match function_type {
FunctionType::Fixed(FixedFunction { returns, .. }) => {
ContractInterfaceAtomType::from_type_signature(&returns)
ContractInterfaceAtomType::from_type_signature(returns)
}
_ => return Err(CheckErrors::Expects(
"Contract functions should only have fixed function return types!"
Expand All @@ -287,7 +287,7 @@ impl ContractInterfaceFunction {
},
args: match function_type {
FunctionType::Fixed(FixedFunction { args, .. }) => {
ContractInterfaceFunctionArg::from_function_args(&args)
ContractInterfaceFunctionArg::from_function_args(args)
}
_ => {
return Err(CheckErrors::Expects(
Expand Down
10 changes: 5 additions & 5 deletions clarity/src/vm/analysis/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ impl CheckErrors {
/// Does this check error indicate that the transaction should be
/// rejected?
pub fn rejectable(&self) -> bool {
match &self {
CheckErrors::SupertypeTooLarge | CheckErrors::Expects(_) => true,
_ => false,
}
matches!(
self,
CheckErrors::SupertypeTooLarge | CheckErrors::Expects(_)
)
}
}

Expand Down Expand Up @@ -323,7 +323,7 @@ pub fn check_arguments_at_most<T>(expected: usize, args: &[T]) -> Result<(), Che
}
}

fn formatted_expected_types(expected_types: &Vec<TypeSignature>) -> String {
fn formatted_expected_types(expected_types: &[TypeSignature]) -> String {
let mut expected_types_joined = format!("'{}'", expected_types[0]);

if expected_types.len() > 2 {
Expand Down
6 changes: 3 additions & 3 deletions clarity/src/vm/analysis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
pub mod analysis_db;
pub mod arithmetic_checker;
pub mod contract_interface_builder;
#[allow(clippy::result_large_err)]
pub mod errors;
pub mod read_only_checker;
pub mod trait_checker;
Expand Down Expand Up @@ -52,7 +51,7 @@ pub fn mem_type_check(
epoch: StacksEpochId,
) -> CheckResult<(Option<TypeSignature>, ContractAnalysis)> {
let contract_identifier = QualifiedContractIdentifier::transient();
let mut contract = build_ast_with_rules(
let contract = build_ast_with_rules(
&contract_identifier,
snippet,
&mut (),
Expand All @@ -68,7 +67,7 @@ pub fn mem_type_check(
let cost_tracker = LimitedCostTracker::new_free();
match run_analysis(
&QualifiedContractIdentifier::transient(),
&mut contract,
&contract,
&mut analysis_db,
false,
cost_tracker,
Expand Down Expand Up @@ -120,6 +119,7 @@ pub fn type_check(
.map_err(|(e, _cost_tracker)| e)
}

#[allow(clippy::too_many_arguments)]
pub fn run_analysis(
contract_identifier: &QualifiedContractIdentifier,
expressions: &[SymbolicExpression],
Expand Down
Loading

0 comments on commit 1819f2a

Please sign in to comment.