Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
feat: update sender.Send
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Apr 18, 2024
1 parent c7db741 commit c6879f5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions prover/proof_submitter/transaction/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package transaction

import (
"context"
"fmt"
"math/big"
"strings"

Expand Down Expand Up @@ -41,6 +42,15 @@ func (s *Sender) Send(
proofWithHeader *producer.ProofWithHeader,
buildTx TxBuilder,
) error {
// Check if we still need to generate a new proof for that block.
proofStatus, err := rpc.GetBlockProofStatus(ctx, s.rpc, proofWithHeader.BlockID, proofWithHeader.Opts.ProverAddress)
if err != nil {
return err
}
if proofStatus.IsSubmitted {
return fmt.Errorf("proof for block %d is already submitted", proofWithHeader.BlockID)
}

// Check if this proof is still needed to be submitted.
ok, err := s.validateProof(ctx, proofWithHeader)
if err != nil || !ok {
Expand Down

0 comments on commit c6879f5

Please sign in to comment.