diff --git a/.changelog/4081.bugfix.md b/.changelog/4081.bugfix.md new file mode 100644 index 00000000000..dae5ca1596b --- /dev/null +++ b/.changelog/4081.bugfix.md @@ -0,0 +1 @@ +ias/proxy/client: `GetSigRL` don't panic if IAS proxy not configured diff --git a/.changelog/4083.bugfix.md b/.changelog/4083.bugfix.md new file mode 100644 index 00000000000..019f25e6c8b --- /dev/null +++ b/.changelog/4083.bugfix.md @@ -0,0 +1 @@ +go/worker/executor: skip proposer timeout if batch was received diff --git a/go/ias/proxy/client/client.go b/go/ias/proxy/client/client.go index 0e5160cbaaf..39fd9718866 100644 --- a/go/ias/proxy/client/client.go +++ b/go/ias/proxy/client/client.go @@ -80,6 +80,9 @@ func (c *proxyClient) GetSPIDInfo(ctx context.Context) (*api.SPIDInfo, error) { } func (c *proxyClient) GetSigRL(ctx context.Context, epidGID uint32) ([]byte, error) { + if c.endpoint == nil { + return nil, fmt.Errorf("IAS proxy is not configured, mock used") + } return c.endpoint.GetSigRL(ctx, epidGID) } diff --git a/go/worker/compute/executor/committee/node.go b/go/worker/compute/executor/committee/node.go index a2616d8f92c..ee54f2f9a7b 100644 --- a/go/worker/compute/executor/committee/node.go +++ b/go/worker/compute/executor/committee/node.go @@ -765,7 +765,7 @@ func (n *Node) proposeTimeoutLocked(roundCtx context.Context) error { ) n.proposingTimeout = true tx := roothash.NewRequestProposerTimeoutTx(0, nil, n.commonNode.Runtime.ID(), n.commonNode.CurrentBlock.Header.Round) - go func() { + go func(round uint64) { // Wait a bit before actually proposing a timeout, to give the current // scheduler some time to propose a batch in case it just received it. // @@ -776,8 +776,23 @@ func (n *Node) proposeTimeoutLocked(roundCtx context.Context) error { select { case <-time.After(proposeTimeoutDelay): case <-roundCtx.Done(): + n.logger.Info("not requesting proposer timeout, round context canceled") + return + } + + // Make sure we are still in the right state/round. + n.commonNode.CrossNode.Lock() + if _, ok := n.state.(StateWaitingForBatch); !ok || round != n.commonNode.CurrentBlock.Header.Round { + n.logger.Info("not requesting proposer timeout", + "height", n.commonNode.Height, + "current_block_round", n.commonNode.CurrentBlock.Header.Round, + "proposing_round", round, + "state", n.state, + ) + n.commonNode.CrossNode.Unlock() return } + n.commonNode.CrossNode.Unlock() err := consensus.SignAndSubmitTx(roundCtx, n.commonNode.Consensus, n.commonNode.Identity.NodeSigner, tx) switch err { @@ -797,7 +812,7 @@ func (n *Node) proposeTimeoutLocked(roundCtx context.Context) error { n.proposingTimeout = false n.commonNode.CrossNode.Unlock() } - }() + }(n.commonNode.CurrentBlock.Header.Round) return nil }