From 9855898ced4be4dc893e156862051aff11e3a6cb Mon Sep 17 00:00:00 2001 From: rjonczy Date: Mon, 18 Mar 2024 10:35:46 +0100 Subject: [PATCH 1/2] fix ci for building tags --- .github/workflows/docker-image-hyperspace.yml | 29 ++++++++++++++--- .github/workflows/docker-image-indexer.yml | 32 +++++++++++++++++-- 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docker-image-hyperspace.yml b/.github/workflows/docker-image-hyperspace.yml index acb0f247f..d2bc791a0 100644 --- a/.github/workflows/docker-image-hyperspace.yml +++ b/.github/workflows/docker-image-hyperspace.yml @@ -48,14 +48,23 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Extract metadata (tags, labels) for Docker - id: meta + - name: Extract metadata (tags, labels) for Docker (tag) + id: meta-tag + if: github.ref_type == 'tag' uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} + + - name: Extract metadata (tags, labels) for Docker (branch) + id: meta-branch + if: github.ref_type == 'branch' + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | type=ref,event=branch type=sha,prefix={{branch}}- @@ -66,10 +75,20 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Docker image + - name: Build and push Docker image (tag) + if: github.ref_type == 'tag' + uses: docker/build-push-action@v5 + with: + file: scripts/hyperspace.Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-tag.outputs.tags }} + labels: ${{ steps.meta-tag.outputs.labels }} + + - name: Build and push Docker image (branch) + if: github.ref_type == 'branch' uses: docker/build-push-action@v5 with: file: scripts/hyperspace.Dockerfile push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta-branch.outputs.tags }} + labels: ${{ steps.meta-branch.outputs.labels }} \ No newline at end of file diff --git a/.github/workflows/docker-image-indexer.yml b/.github/workflows/docker-image-indexer.yml index c7b860687..2491183b6 100644 --- a/.github/workflows/docker-image-indexer.yml +++ b/.github/workflows/docker-image-indexer.yml @@ -48,14 +48,23 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Extract metadata (tags, labels) for Docker - id: meta + - name: Extract metadata (tags, labels) for Docker (tag) + id: meta-tag + if: github.ref_type == 'tag' uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} + + - name: Extract metadata (tags, labels) for Docker (branch) + id: meta-branch + if: github.ref_type == 'branch' + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | type=ref,event=branch type=sha,prefix={{branch}}- @@ -73,3 +82,22 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + + + - name: Build and push Docker image (tag) + if: github.ref_type == 'tag' + uses: docker/build-push-action@v5 + with: + file: scripts/indexer.Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-tag.outputs.tags }} + labels: ${{ steps.meta-tag.outputs.labels }} + + - name: Build and push Docker image (branch) + if: github.ref_type == 'branch' + uses: docker/build-push-action@v5 + with: + file: scripts/indexer.Dockerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-branch.outputs.tags }} + labels: ${{ steps.meta-branch.outputs.labels }} \ No newline at end of file From 4283d5a1073a0f88f0d185d7788517b188250cae Mon Sep 17 00:00:00 2001 From: rustdev Date: Mon, 18 Mar 2024 16:17:47 +0000 Subject: [PATCH 2/2] fix tm validation on yui solidity. --- .../ics07-tendermint/src/client_message.rs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/light-clients/ics07-tendermint/src/client_message.rs b/light-clients/ics07-tendermint/src/client_message.rs index 8ca264e5b..a753e119b 100644 --- a/light-clients/ics07-tendermint/src/client_message.rs +++ b/light-clients/ics07-tendermint/src/client_message.rs @@ -335,9 +335,22 @@ impl Header { let mut bitmask: u64 = 0; - for (index, (i, vote)) in non_absent_votes.enumerate() { + for (index, s) in signed_header.commit.signatures.iter().enumerate() { + + let validator_address = match s { + CommitSig::BlockIdFlagAbsent { .. } => None, + CommitSig::BlockIdFlagCommit { validator_address, .. } => + Some(*validator_address), + CommitSig::BlockIdFlagNil { validator_address, .. } => + Some(*validator_address), + }; + + let vote = match validator_address { + Some(vote) => vote, + None => continue, + }; - let pub_key = &self.validator_set.validators().iter().find(|x| x.address == vote.validator_address).unwrap().pub_key; + let pub_key = &self.validator_set.validators().iter().find(|x| x.address == vote).unwrap().pub_key; let p = pub_key; let mut f_pub_key = None; match p { @@ -353,12 +366,13 @@ impl Header { }; if validator == 1 { - let str_pub_key = hex::encode(vote.validator_address); + let str_pub_key = hex::encode(vote); log::info!(target: "hyperspace", "Validator when bitmask index: {} : address {:?} Voting Power: {:?}", index, str_pub_key, self.validator_set.validators()[index].power()); bitmask |= 1 << index; } } + log::info!(target: "hyperspace", "Header Height: {:?} Bitmask : {} Validators : {:?}", self.height(), bitmask, ret); Ok((ret, bitmask)) } }