Why should we use writeFinal
when recording a final state to Vstorage
#8812
-
When we retrieve a recorder object from the // below here differs from writeFinal()
this.state.closed = true;
return publisher.finish(value); I understand that the best practice is to use writeFinal when we are executing a final call to publish the completion value. Which will prevent that node value from being updated again. What I would like to understand in more depth is if this pattern was implemented to protect the developer in case of fault design in the contract or if it has any overload to Agoric chain to keep the Publish object listening to updates? Thank you all in advance |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@gibson042 ? thoughts? |
Beta Was this translation helpful? Give feedback.
-
The former. Our async sequence publisher pattern consists of a { publish, finish, fail } trio as described at @agoric/notifier and Notifiers and Subscriptions, and the RecorderKit interface is built on top of it. Also, finalization applies to the Is that sufficiently clear? |
Beta Was this translation helpful? Give feedback.
The former. Our async sequence publisher pattern consists of a { publish, finish, fail } trio as described at @agoric/notifier and Notifiers and Subscriptions, and the RecorderKit interface is built on top of it. Also, finalization applies to the
publisher
object but not to the chain storage node that ultimately receives its data—a distinct publisher object associated with the same chain storage node can still continue writing to it.Is that sufficiently…