Skip to content

Improve tx verification error for ValidUntilBlock check failure #4102

@ixje

Description

@ixje

Is your feature request related to a problem? Please describe.

I'm always frustrated when a tx fails but the verification error doesn't contain enough details to know how to resolve the problem. e.g.

transaction e1caca64d67a80a3cbceec9f553123ff6879e2a4f8404571b575bf86ef56b399 failed to verify: transaction has expired: ValidUntilBlock = 1001, current height = 1

My memory (and test case) said a 1000 blocks is the max valid. Under those assumptions the above error message makes no sense.

Looking at

neo-go/pkg/core/blockchain.go

Lines 2931 to 2932 in 39f8079

if t.ValidUntilBlock <= height || !isPartialTx && t.ValidUntilBlock > height+bc.GetMaxValidUntilBlockIncrement() {
return fmt.Errorf("%w: ValidUntilBlock = %d, current height = %d", ErrTxExpired, t.ValidUntilBlock, height)

GetMaxValidUntilBlockIncrement() must return a different value than the 1000 I expect(ed).

Describe the solution you'd like

I would like some addition indicating what the max allowed value would have been to pass e.g.

ValidUntilBlock = 1001, current height = 1, max valid = 501

Describe alternatives you've considered

n/a

Additional context

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    I3Minimal impactS4RoutineU4Nothing urgentenhancementImproving existing functionality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions