Garbage getOrCreate receive left in tuplescpace by RevVault findOrCreate

Description

As found by , the receive in RevVault.rho:66 is not going to be cancelled out by a corresponding send unless the vault we try to findOrCreate does not exist - which means every lookup of a previously existing vault results in a garbage continuation being stored. This is mainly because we didn't know how to encode lambdas in rholang back when this was written.

This should be rephrased by passing a quoted receive into _getOrCreate (along with the name it listens at), and un-quoting (registering) it only in the case where there was no vault to get.

See my messages in #rholang for more context on how to encode lambdas in rholang:
https://discordapp.com/channels/391435113415573504/408650938367213568/581803683642081280

EDIT: We can probably do even better than described in discord by just passing a โ€œforโ€, and then pattern-matching on it to reclaim the name. Hit Artur Gajowy in the discord for more details

Environment

None

Assignee

Mike Stay

Reporter

Artur Gajowy

Priority

Medium

Affects versions

None

Components

Sprint

Labels

Story Points

8
Configure