Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread returns on a different wire than it was called on #6941

Open
ixv opened this issue Mar 18, 2024 · 1 comment
Open

Thread returns on a different wire than it was called on #6941

ixv opened this issue Mar 18, 2024 · 1 comment

Comments

@ixv
Copy link
Contributor

ixv commented Mar 18, 2024

I have a segment of code that looks like this:

  ?:  ?=([%khan %arow *] sign-arvo)
     ?.  ?=(%.y -.p.sign-arvo)
       %-  (slog tang.p.p.sign-arvo)
       `this
     ::
     ?:  ?=([%volt %get-invoice @ @ ~] wire)
       =/  ship  (slav %p i.t.t.wire)
       =*  tid   i.t.t.t.wire
       =+  !<(upd=update:volt q.p.p.sign-arvo)
       ?>  ?=(%new-invoice -.upd)
       =/  w=^wire  /volt/send-payment/[tid]
       ~&  >>  outgoing-wire+w
       =/  =command:volt  [%send-payment payreq.upd `ship]
       :_  this
       (send-payment:core w command)^~
     ::
     ?:  ?=([%volt %send-payment @ ~] wire)
       =*  tid  i.t.t.wire
       ~&  >>  incoming-wire+wire
       =^  cards  state
         (submit-tool-call:core tid [%pay-success ~])
       [cards this]

ie: you call get-invoice, it returns and then calls send-payment. But the wire that you use when calling send-payment is not the wire that send-payment returns on.

From the dojo:

>>  [%outgoing-wire /volt/send-payment/thread_zoUyuybqWKx6UXSLziRymMn2]
>>  [%incoming-wire i=%~.volt t=[i=%~.send-payment t=[i=~.thread_yQg1uWvMycSezjVH1tFD2bw8 t=~]]]
spider got input for non-existent ~[~.khan-fyrd--0v2.bp61q.rns9h.b86rq.o79lv.8qvfk]

That second wire doesn't come from nowhere though, if I do this twice in a row, the incoming wire will match the outgoing wire of the previous run.

But if I nuke spider and revive it, it hangs after the send-payment call, printing the outgoing wire but not the incoming one.

Seems like maybe there's some stale state in spider, but I don't know how to reproduce this from scratch. If someone wants to look into this I'm down to jump in a call and give you access to the ship its running on.

@pkova
Copy link
Collaborator

pkova commented Mar 19, 2024

If you chop and zip up the pier we'll take a look. DM or email me with the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants