ledgerloops / strategy-pit

Testing ground for LedgerLoop strategies
Apache License 2.0
0 stars 0 forks source link

Use of promises in simulator #10

Closed michielbdejong closed 5 months ago

michielbdejong commented 5 months ago

It feels a bit sketchy to await promises across nodes in the simulator. But maybe it's OK in the BatchedMessageForwarder, so all effects of one message get played out until all the triggered messages are queued for the next batch?

michielbdejong commented 5 months ago

Ah but this doesn't work of course if the promises include waiting for a raise-hand message to be delivered!

I moved from outbox to promises because I want to do an isVirginFor check just in time before actually sending a probe. But the current setup with promises has the problem that alice.meet(bob); doesn't complete within one flush of BatchedMessageForwarder. So maybe the third solution is to queue the offerProbe tasks. Maybe I can achieve that by removing await for that call?

michielbdejong commented 5 months ago

The Polite protocol is only needed for Probes! So I think I will put the semaphore mechanism directly into Butterfly.

michielbdejong commented 5 months ago

Meet messages and Loop messages wouldn't normally cross in mid-air.