Skip to content

Instantly share code, notes, and snippets.

@gfpacheco
Created August 12, 2020 18:41
Show Gist options
  • Save gfpacheco/f149ee8fbc81bb5e126db308a802260b to your computer and use it in GitHub Desktop.
Save gfpacheco/f149ee8fbc81bb5e126db308a802260b to your computer and use it in GitHub Desktop.

Hello Why, we’re having issues getting the submit voucher message on the chain, do you think you can help us?

These are the steps that end up returning the ExitCode 1 for the submit voucher message:

  1. CLIENT creates the payment channel
{
  "Message": {
    "From": "t16w4gy7cx7l37ouxsorwdedwjkclj67hbeq4zdli",
    "GasLimit": 20000000,
    "GasPrice": "1",
    "Method": 2,
    "Nonce": 35,
    "Params": "gtgqWBkAAVUAFGZpbC8xL3BheW1lbnRjaGFubmVsWC2CVQH1uGx8V/r391LydGwyDslQlp984VUBx6xmIHPSEwqrGxudwtRetKwnOXk=",
    "To": "t01",
    "Value": "2541000"
  },
  "Signature": {
    "Data": "KgwwaqtcNV4HbHFZMPtIKMNbNs+RN/+/c02SAL9g1SFQr/AbLVUktHdvVTRn+bPWrP3lpYncE41ExcFnZC6NgwA=",
    "Type": 1
  }
}

// Message id: bafy2bzaceb7amsjfe64duescrivitpwnqegdqykvnfhbkiwhtixxyzfcypg3a
  1. Message gets on the chain
{
  "Receipt": {
    "ExitCode": 0,
    "Return": "gkQAyYYDVQI8HqokRBrhI3s+rlH1mBjGHkxCtw==",
    "GasUsed": 10406444
  }
}

// Payment channel address: t2hqpkujcedlqsg6z6vzi7lgayyypeyqvxhokpjti
  1. CLIENT sends a signed voucher to PROVIDER

  2. PROVIDER sends the file to CLIENT

  3. CLIENT settles the payment channel

{
  "From": "t16w4gy7cx7l37ouxsorwdedwjkclj67hbeq4zdli",
  "GasLimit": 20000000,
  "GasPrice": "1",
  "Method": 3,
  "Nonce": 36,
  "To": "t2hqpkujcedlqsg6z6vzi7lgayyypeyqvxhokpjti",
  "Value": "0"
}

// Message id: bafy2bzacedug7poqeqmmr3f5nawvot3n3pxazjbdrf5vhzpq3zbl3amztsin4
  1. Message gets on the chain
{
  "Receipt": {
    "ExitCode": 0,
    "Return": null,
    "GasUsed": 1225593
  }
}

// Payment channel should be settled
  1. PROVIDER submits the voucher
{
  "Message": {
    "To": "t2hqpkujcedlqsg6z6vzi7lgayyypeyqvxhokpjti",
    "From": "t1y6wgmidt2ijqvky3doo4fvc6wswcoolzvugue4a",
    "Value": "0",
    "Method": 2,
    "Params": "g4oAAED2AABEACbFyACAWEIBBWTHibpSMlJoaXWyg10yRae1zcQBSaI3GWaRBpdQT/1SOJxDUVtqosK/tiaT1ZZqW/E27s27r+842ej8MrnArwBAQA==",
    "GasLimit": 20000000,
    "GasPrice": "1",
    "Nonce": 5
  },
  "Signature": {
    "Type": 1,
    "Data": "8Wj/xllP/CyIRZMRYW0mz2PvZk8I4wu0pwT3GuOmJT9Tqz+Y0L4OghSVxvTTf28V7+8U328/C96MEYUWpXrNOwE="
  }
}

// Message id: bafy2bzacecoz4urbwhbvkajym6tk4il57mgfm5tjq64nzssmc3vuw64sruzzk
  1. Message doesn’t get on the chain
{
  "Receipt": {
    "ExitCode": 1,
    "Return": null,
    "GasUsed": 480263
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment