Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/stacks-network/stacks-core
Browse files Browse the repository at this point in the history
… into bug/validation-queue-race-condition
  • Loading branch information
jferrant committed Dec 18, 2024
2 parents 6d23916 + c900752 commit 7519cdb
Show file tree
Hide file tree
Showing 104 changed files with 5,495 additions and 3,381 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/bitcoin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,18 @@ 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_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
- tests::signer::v0::block_commit_delay
- tests::signer::v0::continue_after_fast_block_no_sortition
- 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::signer::v0::no_reorg_due_to_successive_block_validation_ok
- tests::nakamoto_integrations::burn_ops_integration_test
- tests::nakamoto_integrations::check_block_heights
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 --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
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,25 @@ 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

- A miner will now generate a tenure-extend when at least 70% of the signers have confirmed that they are willing to allow one, via the new timestamp included in block responses. This allows the miner to refresh its budget in between Bitcoin blocks. ([#5476](https://github.com/stacks-network/stacks-core/discussions/5476))

### Changed

## [3.1.0.0.0]

### Added

- **SIP-029 consensus rules, activating in epoch 3.1 at block 875,000** (see [SIP-029](https://github.com/stacksgov/sips/blob/main/sips/sip-029/sip-029-halving-alignment.md) for details)
- New RPC endpoints
- `/v2/clarity/marf/:marf_key_hash`
- `/v2/clarity/metadata/:principal/:contract_name/:clarity_metadata_key`
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
2 changes: 1 addition & 1 deletion clarity/src/vm/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ mod test {
) -> std::result::Result<ExecutionCost, CostErrors> {
self.invoked_functions.push((cost_f, input.to_vec()));
self.invocation_count += 1;
Ok(ExecutionCost::zero())
Ok(ExecutionCost::ZERO)
}
fn add_cost(&mut self, _cost: ExecutionCost) -> std::result::Result<(), CostErrors> {
self.cost_addition_count += 1;
Expand Down
12 changes: 6 additions & 6 deletions clarity/src/vm/contexts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ impl EventBatch {

impl<'a, 'hooks> OwnedEnvironment<'a, 'hooks> {
#[cfg(any(test, feature = "testing"))]
pub fn new(database: ClarityDatabase<'a>, epoch: StacksEpochId) -> OwnedEnvironment<'a, '_> {
pub fn new(database: ClarityDatabase<'a>, epoch: StacksEpochId) -> OwnedEnvironment<'a, 'a> {
OwnedEnvironment {
context: GlobalContext::new(
false,
Expand All @@ -513,7 +513,7 @@ impl<'a, 'hooks> OwnedEnvironment<'a, 'hooks> {
}

#[cfg(any(test, feature = "testing"))]
pub fn new_toplevel(mut database: ClarityDatabase<'a>) -> OwnedEnvironment<'a, '_> {
pub fn new_toplevel(mut database: ClarityDatabase<'a>) -> OwnedEnvironment<'a, 'a> {
database.begin();
let epoch = database.get_clarity_epoch_version().unwrap();
let version = ClarityVersion::default_for_epoch(epoch);
Expand All @@ -540,7 +540,7 @@ impl<'a, 'hooks> OwnedEnvironment<'a, 'hooks> {
mut database: ClarityDatabase<'a>,
epoch: StacksEpochId,
use_mainnet: bool,
) -> OwnedEnvironment<'a, '_> {
) -> OwnedEnvironment<'a, 'a> {
use crate::vm::tests::test_only_mainnet_to_chain_id;
let cost_track = LimitedCostTracker::new_max_limit(&mut database, epoch, use_mainnet)
.expect("FAIL: problem instantiating cost tracking");
Expand All @@ -557,7 +557,7 @@ impl<'a, 'hooks> OwnedEnvironment<'a, 'hooks> {
chain_id: u32,
database: ClarityDatabase<'a>,
epoch_id: StacksEpochId,
) -> OwnedEnvironment<'a, '_> {
) -> OwnedEnvironment<'a, 'a> {
OwnedEnvironment {
context: GlobalContext::new(
mainnet,
Expand All @@ -576,7 +576,7 @@ impl<'a, 'hooks> OwnedEnvironment<'a, 'hooks> {
database: ClarityDatabase<'a>,
cost_tracker: LimitedCostTracker,
epoch_id: StacksEpochId,
) -> OwnedEnvironment<'a, '_> {
) -> OwnedEnvironment<'a, 'a> {
OwnedEnvironment {
context: GlobalContext::new(mainnet, chain_id, database, cost_tracker, epoch_id),
call_stack: CallStack::new(),
Expand Down Expand Up @@ -1546,7 +1546,7 @@ impl<'a, 'hooks> GlobalContext<'a, 'hooks> {
database: ClarityDatabase<'a>,
cost_track: LimitedCostTracker,
epoch_id: StacksEpochId,
) -> GlobalContext {
) -> GlobalContext<'a, 'hooks> {
GlobalContext {
database,
cost_track,
Expand Down
Loading

0 comments on commit 7519cdb

Please sign in to comment.