Stale StaticPointers result in unspendable states

Description

1, 2 and 3 are an evolving state. The static pointer pointed to 2 when it was unconsumed. The state then evolved to 3, which locks the state with a static pointer, and nothing can be done with it, because it's no longer pointing at an unconsumed state. This is because the transaction builder auto-magically adds reference states for all StatePointers and then because the notary always checks that reference states are current.

Possible resolutions in order of ascending effort:

  1. Document that StaticPointers should only be used when the pointed to state never changes. E.g. for on-ledger reference data which is truly static.

  2. Change transaction builder such that resolution of pointers is optional. This is the easiest fix.

  3. Change the behaviour for reference states such that input state refs can contain pointers to stale states.. this allows the pointed to state ref to be updated when the new output is created. This was an idea from Matthew Layton.

 

Status

Assignee

Matt Layton

Reporter

Roger Willis

Feature Team

Vanguard

Story Points

None

Fix versions

Ported to...

Corda 4.3

Priority

High

Affects versions

Configure