From 6c5349b0422c5c88db02d578720467c16b102ab2 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Wed, 16 Feb 2022 15:33:29 +0100 Subject: [PATCH 1/2] ci: build multi-platform docker images (#2959) * feat: build multi-platform docker image for Dockerfile.stretch * chore: temporary always push branch * ci: update alpine docker build and platform selection * ci: remove buildx for alpine build, configure pr docker tag * ci: create multi-platform alpine * test: temporarily always build multi-arch * fix: multi-arch alpine build needs docker buildx and qemu * ci: add new multiplatform workflow; rename or remove old workflows; remove notify jobs * ci: workflow syntax * ci: no vars allowed here * ci: reference current branch for testing * ci: test docker platforms job * ci: remove temp workflow settings Co-authored-by: CharlieC3 <2747302+CharlieC3@users.noreply.github.com> --- .../{stacks-blockchain.yml => ci.yml} | 133 ++++++++---------- .github/workflows/docker-platforms.yml | 125 ++++++++++++++++ .github/workflows/v1-v2-migration.yml | 109 -------------- 3 files changed, 187 insertions(+), 180 deletions(-) rename .github/workflows/{stacks-blockchain.yml => ci.yml} (75%) create mode 100644 .github/workflows/docker-platforms.yml delete mode 100644 .github/workflows/v1-v2-migration.yml diff --git a/.github/workflows/stacks-blockchain.yml b/.github/workflows/ci.yml similarity index 75% rename from .github/workflows/stacks-blockchain.yml rename to .github/workflows/ci.yml index 7250d7fa8a..b20a74ac20 100644 --- a/.github/workflows/stacks-blockchain.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: stacks-blockchain +name: CI # Only run when: # - PRs are opened against the master branch @@ -18,24 +18,6 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: - # Notify Slack channel of workflow start - notify-start: - runs-on: ubuntu-latest - # Only run on non-PR events or only PRs that aren't from forks - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository - outputs: - slack_message_id: ${{ steps.slack.outputs.message_id }} - steps: - - name: Notify slack start - id: slack - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1.1.2 - with: - channel: devops-notify - status: STARTING - color: warning - # Run full genesis test full-genesis: runs-on: ubuntu-latest @@ -127,7 +109,7 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Build distributable - uses: docker/build-push-action@v2.2.1 + uses: docker/build-push-action@v2 with: file: build-scripts/Dockerfile.${{ matrix.platform }} outputs: dist/${{ matrix.platform }} @@ -145,6 +127,15 @@ jobs: name: ${{ matrix.platform }} path: ${{ matrix.platform }}.zip + call-docker-platforms-workflow: + if: ${{ github.event.inputs.tag != '' }} + uses: stacks-network/stacks-blockchain/.github/workflows/docker-platforms.yml@master + with: + tag: ${{ github.event.inputs.tag }} + secrets: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + # Build docker image, tag it with the git tag and `latest` if running on master branch, and publish under the following conditions # Will publish if: # - a tag was passed into this workflow @@ -154,21 +145,39 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - name: Set Vars run: | echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV echo "GITHUB_REF_SHORT=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Build/Tag/Push Image - uses: docker/build-push-action@v1 + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + blockstack/${{ github.event.repository.name }} + tags: | + type=ref,event=branch + type=ref,event=pr + ${{ github.event.inputs.tag }} + + - name: Login to DockerHub + uses: docker/login-action@v1 with: - repository: blockstack/${{ github.workflow }} username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - tags: ${{ github.event.inputs.tag }} - tag_with_ref: true - add_git_labels: true - build_args: STACKS_NODE_VERSION=${{ github.event.inputs.tag || env.GITHUB_SHA_SHORT }},GIT_BRANCH=${{ env.GITHUB_REF_SHORT }},GIT_COMMIT=${{ env.GITHUB_SHA_SHORT }} + + - name: Build/Tag/Push Image + uses: docker/build-push-action@v2 + with: + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + STACKS_NODE_VERSION=${{ github.event.inputs.tag || env.GITHUB_SHA_SHORT }} + GIT_BRANCH=${{ env.GITHUB_REF_SHORT }} + GIT_COMMIT=${{ env.GITHUB_SHA_SHORT }} # Only push if (a tag was passed in) or (we're building a non-master branch which isn't a PR) push: ${{ github.event.inputs.tag != '' || (github.ref != 'refs/heads/master' && !contains(github.ref, 'refs/pull')) }} @@ -182,6 +191,7 @@ jobs: steps: - uses: actions/checkout@v2 # Stretch tag will be "-stretch" if a tag was passed in, otherwise "-stretch". If the BRANCH is master, will result in "latest-stretch" + # Also determines platforms to be build in docker step - name: Determine Stretch Tag run: | if [[ -z ${TAG} ]]; then @@ -202,17 +212,34 @@ jobs: echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV echo "GITHUB_REF_SHORT=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Build/Tag/Push Image - uses: docker/build-push-action@v1 + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + blockstack/${{ github.event.repository.name }} + tags: | + type=ref,event=branch + type=ref,event=pr + ${{ env.STRETCH_TAG }} + + - name: Login to DockerHub + uses: docker/login-action@v1 with: - repository: blockstack/${{ github.workflow }} - dockerfile: Dockerfile.stretch username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - tags: ${{ env.STRETCH_TAG }} - tag_with_ref: false - add_git_labels: true - build_args: STACKS_NODE_VERSION=${{ github.event.inputs.tag || env.GITHUB_SHA_SHORT }},GIT_BRANCH=${{ env.GITHUB_REF_SHORT }},GIT_COMMIT=${{ env.GITHUB_SHA_SHORT }} + + - name: Build/Tag/Push Image + uses: docker/build-push-action@v2 + with: + platforms: linux/amd64 + file: Dockerfile.stretch + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + STACKS_NODE_VERSION=${{ github.event.inputs.tag || env.GITHUB_SHA_SHORT }} + GIT_BRANCH=${{ env.GITHUB_REF_SHORT }} + GIT_COMMIT=${{ env.GITHUB_SHA_SHORT }} # Only push if (a tag was passed in) or (we're building a non-master branch which isn't a PR) push: ${{ github.event.inputs.tag != '' || (github.ref != 'refs/heads/master' && !contains(github.ref, 'refs/pull')) }} @@ -268,39 +295,3 @@ jobs: asset_path: ./dist/${{ matrix.platform }}.zip asset_name: ${{ matrix.platform }}.zip asset_content_type: application/zip - - # Notify Slack channel of workflow end - notify-end: - runs-on: ubuntu-latest - needs: - - notify-start - - dist - - build-publish - - build-publish-stretch - - create-release - - upload-dist - if: always() - steps: - - name: Notify slack success - # Only run on non-PR events or only PRs that aren't from forks - if: (!contains(needs.*.result, 'failure')) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1.1.2 - with: - message_id: ${{ needs.notify-start.outputs.slack_message_id }} - channel: devops-notify - status: SUCCESS - color: good - - - name: Notify slack fail - # Only run on non-PR events or only PRs that aren't from forks - if: (contains(needs.*.result, 'failure')) && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - uses: voxmedia/github-action-slack-notify-build@v1.1.2 - with: - message_id: ${{ needs.notify-start.outputs.slack_message_id }} - channel: devops-notify - status: FAILED - color: danger diff --git a/.github/workflows/docker-platforms.yml b/.github/workflows/docker-platforms.yml new file mode 100644 index 0000000000..7ee44b3eda --- /dev/null +++ b/.github/workflows/docker-platforms.yml @@ -0,0 +1,125 @@ +name: Build/Release Additional Docker Platform Images + +# Only run when: +# - the workflow is automatically triggered during a release with the relevant tag +# - the workflow is started from the UI with a tag +on: + workflow_call: + inputs: + tag: + required: true + type: string + secrets: + DOCKERHUB_USERNAME: + required: true + DOCKERHUB_PASSWORD: + required: true + +env: + BUILD_PLATFORMS: linux/arm64 + +jobs: + # Build docker image, tag it with the branch and docker image tag passed in, and publish + build-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set Vars + run: | + echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "GITHUB_REF_SHORT=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + blockstack/${{ github.event.repository.name }} + tags: | + type=ref,event=branch + ${{ inputs.tag }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Build/Tag/Push Image + uses: docker/build-push-action@v2 + with: + platforms: ${{ env.BUILD_PLATFORMS }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + STACKS_NODE_VERSION=${{ inputs.tag || env.GITHUB_SHA_SHORT }} + GIT_BRANCH=${{ env.GITHUB_REF_SHORT }} + GIT_COMMIT=${{ env.GITHUB_SHA_SHORT }} + push: true + + # Build docker image, tag it with the branch and docker image tag passed in, and publish + build-publish-stretch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Determine Stretch Tag and build platforms + run: | + if [[ -z ${TAG} ]]; then + REF=$(echo ${GITHUB_REF#refs/*/} | tr / -) + if [[ "${REF}" == "master" ]]; then + echo "STRETCH_TAG=latest-stretch" >> $GITHUB_ENV + else + echo "STRETCH_TAG=${REF}-stretch" >> $GITHUB_ENV + fi + else + echo "STRETCH_TAG=${TAG}-stretch" >> $GITHUB_ENV + fi + env: + TAG: ${{ inputs.tag }} + + - name: Set Vars + run: | + echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV + echo "GITHUB_REF_SHORT=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + blockstack/${{ github.event.repository.name }} + tags: | + type=ref,event=branch + ${{ env.STRETCH_TAG }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Build/Tag/Push Image + uses: docker/build-push-action@v2 + with: + platforms: ${{ env.BUILD_PLATFORMS }} + file: Dockerfile.stretch + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + STACKS_NODE_VERSION=${{ inputs.tag || env.GITHUB_SHA_SHORT }} + GIT_BRANCH=${{ env.GITHUB_REF_SHORT }} + GIT_COMMIT=${{ env.GITHUB_SHA_SHORT }} + push: true diff --git a/.github/workflows/v1-v2-migration.yml b/.github/workflows/v1-v2-migration.yml deleted file mode 100644 index ae05a8c0b8..0000000000 --- a/.github/workflows/v1-v2-migration.yml +++ /dev/null @@ -1,109 +0,0 @@ -## -## This workflow is used to help facilitate the V1 -> V2 migration. -## It pulls down the latest V1 export, commits the new chainstate file to a feature branch, -## and opens a PR against the master branch. -## - -name: V1 to V2 Migration - -env: - COMMIT_USER: Hiro DevOps - COMMIT_EMAIL: 45208873+blockstack-devops@users.noreply.github.com - UPDATE_BRANCH: auto/v1-v2-migration - GENESIS_DIR: stx-genesis - CHAINSTATE_URL: https://storage.googleapis.com/blockstack-v1-migration-data/chainstate.txt - CHAINSTATE_METADATA_URL: https://storage.googleapis.com/storage/v1/b/blockstack-v1-migration-data/o/chainstate.txt - CHAINSTATE_HASH_URL: https://storage.googleapis.com/blockstack-v1-migration-data/chainstate.txt.sha256 - CHAINSTATE_HASH_METADATA_URL: https://storage.googleapis.com/storage/v1/b/blockstack-v1-migration-data/o/chainstate.txt.sha256 - NAME_ZONEFILES_URL: https://storage.googleapis.com/blockstack-v1-migration-data/name_zonefiles.txt - NAME_ZONEFILES_METADATA_URL: https://storage.googleapis.com/storage/v1/b/blockstack-v1-migration-data/o/name_zonefiles.txt - NAME_ZONEFILES_HASH_URL: https://storage.googleapis.com/blockstack-v1-migration-data/name_zonefiles.txt.sha256 - NAME_ZONEFILES_HASH_METADATA_URL: https://storage.googleapis.com/storage/v1/b/blockstack-v1-migration-data/o/name_zonefiles.txt.sha256 - MD5_VERIFY_SCRIPT_URL: https://gist.github.com/wileyj/93b4222576cb702053ebfcd3cf9f570b -on: - repository_dispatch: - types: - - migration - -jobs: - run: - runs-on: ubuntu-latest - steps: - - name: Checkout stacks-blockchain - uses: actions/checkout@v2 - with: - token: ${{ secrets.GH_TOKEN }} - ref: next - - - name: Update files - run: | - mkdir -p ${GENESIS_DIR} - curl -s ${CHAINSTATE_URL} > ${GENESIS_DIR}/chainstate.txt - echo "CHAINSTATE_TIME_CREATED=$(curl -s ${CHAINSTATE_METADATA_URL} | jq -r '.timeCreated')" >> $GITHUB_ENV - echo "CHAINSTATE_SIZE=$(curl -s ${CHAINSTATE_METADATA_URL} | jq -r '.size')" >> $GITHUB_ENV - echo "CHAINSTATE_MD5=$(curl -s ${CHAINSTATE_METADATA_URL} | jq -r '.md5Hash')" >> $GITHUB_ENV - echo "CHAINSTATE_DOWNLOAD_LINK=$(curl -s ${CHAINSTATE_METADATA_URL} | jq -r '.mediaLink')" >> $GITHUB_ENV - - curl -s ${CHAINSTATE_HASH_URL} > ${GENESIS_DIR}/chainstate.txt.sha256 - echo "CHAINSTATE_HASH_TIME_CREATED=$(curl -s ${CHAINSTATE_HASH_METADATA_URL} | jq -r '.timeCreated')" >> $GITHUB_ENV - echo "CHAINSTATE_HASH_SIZE=$(curl -s ${CHAINSTATE_HASH_METADATA_URL} | jq -r '.size')" >> $GITHUB_ENV - echo "CHAINSTATE_HASH_MD5=$(curl -s ${CHAINSTATE_HASH_METADATA_URL} | jq -r '.md5Hash')" >> $GITHUB_ENV - echo "CHAINSTATE_HASH_DOWNLOAD_LINK=$(curl -s ${CHAINSTATE_HASH_METADATA_URL} | jq -r '.mediaLink')" >> $GITHUB_ENV - - curl -s ${NAME_ZONEFILES_URL} > ${GENESIS_DIR}/name_zonefiles.txt - echo "NAME_ZONEFILES_TIME_CREATED=$(curl -s ${NAME_ZONEFILES_METADATA_URL} | jq -r '.timeCreated')" >> $GITHUB_ENV - echo "NAME_ZONEFILES_SIZE=$(curl -s ${NAME_ZONEFILES_METADATA_URL} | jq -r '.size')" >> $GITHUB_ENV - echo "NAME_ZONEFILES_MD5=$(curl -s ${NAME_ZONEFILES_METADATA_URL} | jq -r '.md5Hash')" >> $GITHUB_ENV - echo "NAME_ZONEFILES_DOWNLOAD_LINK=$(curl -s ${NAME_ZONEFILES_METADATA_URL} | jq -r '.mediaLink')" >> $GITHUB_ENV - - curl -s ${NAME_ZONEFILES_HASH_URL} > ${GENESIS_DIR}/name_zonefiles.txt.sha256 - echo "NAME_ZONEFILES_HASH_TIME_CREATED=$(curl -s ${NAME_ZONEFILES_HASH_METADATA_URL} | jq -r '.timeCreated')" >> $GITHUB_ENV - echo "NAME_ZONEFILES_HASH_SIZE=$(curl -s ${NAME_ZONEFILES_HASH_METADATA_URL} | jq -r '.size')" >> $GITHUB_ENV - echo "NAME_ZONEFILES_HASH_MD5=$(curl -s ${NAME_ZONEFILES_HASH_METADATA_URL} | jq -r '.md5Hash')" >> $GITHUB_ENV - echo "NAME_ZONEFILES_HASH_DOWNLOAD_LINK=$(curl -s ${NAME_ZONEFILES_HASH_METADATA_URL} | jq -r '.mediaLink')" >> $GITHUB_ENV - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GH_TOKEN }} - commit-message: Update v2 chainstate files - committer: ${{ env.COMMIT_USER }} <${{ env.COMMIT_EMAIL }}> - author: ${{ env.COMMIT_USER }} <${{ env.COMMIT_EMAIL }}> - branch: ${{ env.UPDATE_BRANCH }} - title: "[Stacks v1 → v2 Upgrade] Final update to chainstate files" - body: | - :robot: This is an automated pull request created from reaching the threshold of BNS names registered under the `.miner` namespace. - - **Export triggered at block height: `${{ github.event.client_payload.block_height }}`** - - This PR updates the chainstate file, chainstate consensus hash file, name_zonefile file, and name_zonefile consensus hash file to be used in the creation of the genesis block in the Stacks V2 network: - * [chainstate.txt](${{ env.CHAINSTATE_URL }}) - * Time created: `${{ env.CHAINSTATE_TIME_CREATED }}` - * File size: `${{ env.CHAINSTATE_SIZE }} bytes` - * MD5 Hash: `${{ env.CHAINSTATE_MD5 }}` - * [Verify the MD5 hash with this script](${{ env.MD5_VERIFY_SCRIPT_URL }}) - * [Download file](${{ env.CHAINSTATE_DOWNLOAD_LINK }}) - * [chainstate.txt.sha256](${{ env.CHAINSTATE_HASH_URL }}) - * Time created: `${{ env.CHAINSTATE_HASH_TIME_CREATED }}` - * File size: `${{ env.CHAINSTATE_HASH_SIZE }} bytes` - * MD5 Hash: `${{ env.CHAINSTATE_HASH_MD5 }}` - * [Verify the MD5 hash with this script](${{ env.MD5_VERIFY_SCRIPT_URL }}) - * [Download file](${{ env.CHAINSTATE_HASH_DOWNLOAD_LINK }}) - * [name_zonefiles.txt](${{ env.NAME_ZONEFILES_URL }}) - * Time created: `${{ env.NAME_ZONEFILES_TIME_CREATED }}` - * File size: `${{ env.NAME_ZONEFILES_SIZE }} bytes` - * MD5 Hash: `${{ env.NAME_ZONEFILES_MD5 }}` - * [Verify the MD5 hash with this script](${{ env.MD5_VERIFY_SCRIPT_URL }}) - * [Download file](${{ env.NAME_ZONEFILES_DOWNLOAD_LINK }}) - * [name_zonefiles.txt.sha256](${{ env.NAME_ZONEFILES_HASH_URL }}) - * Time created: `${{ env.NAME_ZONEFILES_HASH_TIME_CREATED }}` - * File size: `${{ env.NAME_ZONEFILES_HASH_SIZE }} bytes` - * MD5 Hash: `${{ env.NAME_ZONEFILES_HASH_MD5 }}` - * [Verify the MD5 hash with this script](${{ env.MD5_VERIFY_SCRIPT_URL }}) - * [Download file](${{ env.NAME_ZONEFILES_HASH_DOWNLOAD_LINK }}) - - Once these changes are eventually merged into the `master` branch, a new tag will need to be created. This can be done one of two ways: - * Trigger this [Github workflow](https://github.com/blockstack/stacks-blockchain/actions?query=workflow%3Astacks-blockchain) from the `master` branch by selecting "Run Workflow", passing in the desired tag to be created as an argument - * Create the new tag from the `master` branch locally and push it up - assignees: jcnelson,kantai,lgalabru,diwakergupta - reviewers: CharlieC3,wileyj,zone117x,jcnelson,kantai,lgalabru,diwakergupta From 3f3ff1280c02abb157278c92aa124944852fb0c8 Mon Sep 17 00:00:00 2001 From: Aaron Blankstein Date: Thu, 28 Apr 2022 15:14:37 -0500 Subject: [PATCH 2/2] fix: duplicate event broadcasts in mocknet node --- testnet/stacks-node/src/node.rs | 50 ++------------------------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/testnet/stacks-node/src/node.rs b/testnet/stacks-node/src/node.rs index 57dd0d9422..0af4e5c6e2 100644 --- a/testnet/stacks-node/src/node.rs +++ b/testnet/stacks-node/src/node.rs @@ -17,8 +17,8 @@ use stacks::chainstate::stacks::events::{ StacksTransactionEvent, StacksTransactionReceipt, TransactionOrigin, }; use stacks::chainstate::stacks::{ - CoinbasePayload, StacksBlock, StacksBlockHeader, StacksMicroblock, StacksTransaction, - StacksTransactionSigner, TransactionAnchorMode, TransactionPayload, TransactionVersion, + CoinbasePayload, StacksBlock, StacksMicroblock, StacksTransaction, StacksTransactionSigner, + TransactionAnchorMode, TransactionPayload, TransactionVersion, }; use stacks::chainstate::{burn::db::sortdb::SortitionDB, stacks::db::StacksEpochReceipt}; use stacks::core::mempool::MemPoolDB; @@ -766,7 +766,7 @@ impl Node { microblocks: Vec, db: &mut SortitionDB, ) -> ChainTip { - let parent_consensus_hash = { + let _parent_consensus_hash = { // look up parent consensus hash let ic = db.index_conn(); let parent_consensus_hash = StacksChainState::get_parent_consensus_hash( @@ -817,30 +817,6 @@ impl Node { parent_consensus_hash }; - // get previous burn block stats - let (parent_burn_block_hash, parent_burn_block_height, parent_burn_block_timestamp) = - if anchored_block.is_first_mined() { - (BurnchainHeaderHash([0; 32]), 0, 0) - } else { - match SortitionDB::get_block_snapshot_consensus(db.conn(), &parent_consensus_hash) - .unwrap() - { - Some(sn) => ( - sn.burn_header_hash, - sn.block_height as u32, - sn.burn_header_timestamp, - ), - None => { - // shouldn't happen - warn!( - "CORRUPTION: block {}/{} does not correspond to a burn block", - &parent_consensus_hash, &anchored_block.header.parent_block - ); - (BurnchainHeaderHash([0; 32]), 0, 0) - } - } - }; - let atlas_config = AtlasConfig::default(false); let mut processed_blocks = vec![]; loop { @@ -921,26 +897,6 @@ impl Node { StacksChainState::consensus_load(&block_path).unwrap() }; - let parent_index_hash = StacksBlockHeader::make_index_block_hash( - &parent_consensus_hash, - &block.header.parent_block, - ); - - self.event_dispatcher.process_chain_tip( - &block, - &metadata, - &receipts, - &parent_index_hash, - Txid([0; 32]), - &vec![], - None, - parent_burn_block_hash, - parent_burn_block_height, - parent_burn_block_timestamp, - &processed_block.anchored_block_cost, - &processed_block.parent_microblocks_cost, - ); - let chain_tip = ChainTip { metadata, block,