Skip to content

Commit ff38a4e

Browse files
committed
fix: address key rotation CI failures
1 parent 295d7f1 commit ff38a4e

5 files changed

Lines changed: 29 additions & 3 deletions

File tree

.github/workflows/proto.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,17 @@ jobs:
1515
- uses: bufbuild/buf-action@v1
1616
with:
1717
format: false
18+
breaking: false
19+
- name: Check protobuf breaking changes
20+
env:
21+
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.merge_group.base_sha || github.event.before }}
22+
run: |
23+
if [ -z "$BASE_SHA" ] || [[ "$BASE_SHA" =~ ^0+$ ]]; then
24+
echo "No base SHA available for buf breaking check"
25+
exit 0
26+
fi
27+
28+
buf breaking proto \
29+
--limit-to-input-files \
30+
--error-format github-actions \
31+
--against "https://github.com/${{ github.repository }}.git#format=git,commit=${BASE_SHA}"

block/internal/syncing/syncer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,9 @@ func (s *Syncer) trySyncNextBlockWithState(ctx context.Context, event *common.DA
750750
s.cache.RemoveHeaderDAIncluded(headerHash)
751751
s.cache.RemoveDataDAIncluded(data.DACommitment().String())
752752

753+
if errors.Is(err, types.ErrUnexpectedProposer) {
754+
return errors.Join(errInvalidBlock, err)
755+
}
753756
if !errors.Is(err, errInvalidState) && !errors.Is(err, errInvalidBlock) {
754757
return errors.Join(errInvalidBlock, err)
755758
}

docs/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ title: Evolve Documentation
44
titleTemplate: ':title'
55
---
66

7+
<!-- markdownlint-disable MD025 MD033 -->
8+
79
<script setup>
810
import constants from './.vitepress/constants/constants.js'
911
</script>

execution/evm/test/execution_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ func TestEngineExecution(t *testing.T) {
129129
allTimestamps = append(allTimestamps, blockTimestamp)
130130

131131
// Execute transactions and get the new state root
132-
newStateRoot, err := executionClient.ExecuteTxs(ctx, payload, blockHeight, blockTimestamp, prevStateRoot)
132+
executeResult, err := executionClient.ExecuteTxs(ctx, payload, blockHeight, blockTimestamp, prevStateRoot)
133133
require.NoError(tt, err)
134+
newStateRoot := executeResult.UpdatedStateRoot
134135

135136
err = executionClient.SetFinal(ctx, blockHeight)
136137
require.NoError(tt, err)
@@ -201,8 +202,9 @@ func TestEngineExecution(t *testing.T) {
201202

202203
// Use timestamp from build phase for each block to ensure proper ordering
203204
blockTimestamp := allTimestamps[blockHeight-1]
204-
newStateRoot, err := executionClient.ExecuteTxs(ctx, payload, blockHeight, blockTimestamp, prevStateRoot)
205+
executeResult, err := executionClient.ExecuteTxs(ctx, payload, blockHeight, blockTimestamp, prevStateRoot)
205206
require.NoError(t, err)
207+
newStateRoot := executeResult.UpdatedStateRoot
206208
if len(payload) == 0 {
207209
require.Equal(tt, prevStateRoot, newStateRoot)
208210
} else {

types/state.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package types
22

33
import (
44
"bytes"
5+
"errors"
56
"fmt"
67
"sync"
78
"time"
@@ -16,6 +17,10 @@ var InitStateVersion = Version{
1617
App: 0,
1718
}
1819

20+
// ErrUnexpectedProposer is returned when a block was signed by a proposer
21+
// different from the proposer expected by the current state.
22+
var ErrUnexpectedProposer = errors.New("unexpected proposer")
23+
1924
// State contains information about current state of the blockchain.
2025
type State struct {
2126
Version Version
@@ -77,7 +82,7 @@ func (s State) AssertValidForNextState(header *SignedHeader, data *Data) error {
7782
return fmt.Errorf("header-data validation failed: %w", err)
7883
}
7984
if len(s.NextProposerAddress) > 0 && !bytes.Equal(header.ProposerAddress, s.NextProposerAddress) {
80-
return fmt.Errorf("unexpected proposer - got: %x, want: %x", header.ProposerAddress, s.NextProposerAddress)
85+
return fmt.Errorf("%w - got: %x, want: %x", ErrUnexpectedProposer, header.ProposerAddress, s.NextProposerAddress)
8186
}
8287
return nil
8388
}

0 commit comments

Comments
 (0)