rchain / rchip-proposals

Where RChain improvement proposals can be submitted
Apache License 2.0
8 stars 5 forks source link

(RNExt-01) - Event processing framework #13

Open SteveHenley opened 4 years ago

SteveHenley commented 4 years ago
  1. RChip -11 ? or is this RExt-01 or RNExt-01? - Need event processing framework - subscribers are notified when an event happens. Should this be a language feature rather than having to look inside the block (as in current)? The kind of events to be implemented to be determined. dApps would like to be notified of changes in some values. A way to implement this in your contract already exists?
    1. Theo: new myevent('rho:io:event') in { myevent!("stuff happened") }
      1. Event + <read only uri> + ("stuff happened") -> events.log

    2. Since this is outside rnode code, may be should be outside Rchip process?
    3. Make read only node reactive or enable publish/subscribe ?
    4. Why can’t we do this - isn’t event similar to stdout that we already have? Perhaps mimic stdout code to enable event generation - Can first byte be checked to see if it’s subscribed to and instead of printing, send that value over to subscribers. Some event bus needs to be implemented.
    5. Need enablement on websockets
    6. Perhaps this should be an extension and not part of core rnode - will enable development of extension market
jimscarver commented 4 years ago

events are critical in ethereum apps for synchronizing external processes. RChain needs that capability somehow. STDOUT fails to identify the source of the output and is thus not trustworthy unless a deployId or other identification is provided for the output..

dckc commented 3 years ago

I just (re?)discovered rho:block:data.

https://github.com/rchain/rchain/blob/2677fcaf57edd2538fdc330400de569bdd1a76cf/casper/src/main/resources/RevVault.rho#L193-L196

It looked like an event mechanism for a minute, but then I realized: it's data going into an event, not a destination for storing events.

For reference, by way of motivation for events:

tgrospic commented 3 years ago

@dckc block data should be like a clock on chain. Contract can calculate how many blocks are passed as time.