diff --git a/pkg/network/protocols/core/protocol.go b/pkg/network/protocols/core/protocol.go index 6be570113..7f49e88b6 100644 --- a/pkg/network/protocols/core/protocol.go +++ b/pkg/network/protocols/core/protocol.go @@ -216,7 +216,7 @@ func (p *Protocol) onBlock(blockData []byte, id peer.ID) { func (p *Protocol) onBlockRequest(idBytes []byte, id peer.ID) { if len(idBytes) != iotago.BlockIDLength { - p.Events.Error.Trigger(ierrors.Wrap(iotago.ErrInvalidIdentifierLength, "failed to deserialize block request"), id) + p.Events.Error.Trigger(ierrors.Errorf("failed to deserialize block request: invalid block id length"), id) return } @@ -237,7 +237,7 @@ func (p *Protocol) onSlotCommitment(commitmentBytes []byte, id peer.ID) { func (p *Protocol) onSlotCommitmentRequest(idBytes []byte, id peer.ID) { if len(idBytes) != iotago.CommitmentIDLength { - p.Events.Error.Trigger(ierrors.Wrap(iotago.ErrInvalidIdentifierLength, "failed to deserialize slot commitment request"), id) + p.Events.Error.Trigger(ierrors.Errorf("failed to deserialize slot commitment request: invalid commitment id length"), id) return } @@ -294,7 +294,7 @@ func (p *Protocol) onAttestations(commitmentBytes []byte, attestationsBytes []by func (p *Protocol) onAttestationsRequest(commitmentIDBytes []byte, id peer.ID) { if len(commitmentIDBytes) != iotago.CommitmentIDLength { - p.Events.Error.Trigger(ierrors.Wrap(iotago.ErrInvalidIdentifierLength, "failed to deserialize commitmentID in attestations request"), id) + p.Events.Error.Trigger(ierrors.Errorf("failed to deserialize commitmentID in attestations request: invalid commitment id length"), id) return } diff --git a/pkg/protocol/engine/ledger/ledger/ledger.go b/pkg/protocol/engine/ledger/ledger/ledger.go index de2dc6aaa..22fc3b200 100644 --- a/pkg/protocol/engine/ledger/ledger/ledger.go +++ b/pkg/protocol/engine/ledger/ledger/ledger.go @@ -612,11 +612,7 @@ func (l *Ledger) processStateDiffTransactions(stateDiff mempool.StateDiff) (spen return false } - inputRefs, errInput := tx.Inputs() - if errInput != nil { - err = ierrors.Errorf("failed to retrieve inputs of %s: %w", txID, errInput) - return false - } + inputRefs := tx.Inputs() // process outputs { @@ -624,7 +620,7 @@ func (l *Ledger) processStateDiffTransactions(stateDiff mempool.StateDiff) (spen for _, inputRef := range lo.Map(inputRefs, mempool.UTXOInputStateRefFromInput) { stateWithMetadata, stateError := l.memPool.StateMetadata(inputRef) if stateError != nil { - err = ierrors.Errorf("failed to retrieve outputs of %s: %w", txID, errInput) + err = ierrors.Wrapf(stateError, "failed to retrieve outputs of %s", txID) return false } spent := utxoledger.NewSpent(l.outputFromState(stateWithMetadata.State()), txWithMeta.ID(), stateDiff.Slot()) diff --git a/pkg/protocol/engine/ledger/ledger/vm.go b/pkg/protocol/engine/ledger/ledger/vm.go index 6e3227b59..a26152e8e 100644 --- a/pkg/protocol/engine/ledger/ledger/vm.go +++ b/pkg/protocol/engine/ledger/ledger/vm.go @@ -65,11 +65,7 @@ func (v *VM) ValidateSignatures(signedTransaction mempool.SignedTransaction, res return nil, iotago.ErrTxTypeInvalid } - contextInputs, err := iotagoSignedTransaction.Transaction.ContextInputs() - if err != nil { - return nil, ierrors.Wrapf(err, "unable to retrieve context inputs from transaction") - } - + contextInputs := iotagoSignedTransaction.Transaction.ContextInputs() utxoInputSet := iotagovm.InputSet{} commitmentInput := (*iotago.Commitment)(nil) bicInputs := make([]*iotago.BlockIssuanceCreditInput, 0)