cartesi / rollups

Cartesi Rollups
30 stars 12 forks source link

The proof siblings in host mode are reversed #194

Closed gligneul closed 1 year ago

gligneul commented 1 year ago

🙂 Expected behavior

The siblings should be in the same order as the machine mode.

🫠 Actual behavior

They are in reverse order

🧪 Minimal test case

It is possible to reproduce this bug in echo-python from rollups examples. Just run the node, send an input, and finish the epoch. Then, obtain the proof with the following command:

curl 'http://localhost:4000/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: http://localhost:4000' --data-binary '{"query":"# Write your query or mutation here\nquery {\n  notices {\n    edges {\n      node {\n        index\n        input {\n          index\n        }\n        payload\n        proof {\n          validity {\n            inputIndexWithinEpoch\n            outputIndexWithinInput\n            outputHashesRootHash\n            vouchersEpochRootHash\n            noticesEpochRootHash\n            machineStateHash\n            outputHashInOutputHashesSiblings\n            outputHashesInEpochSiblings\n          }\n          context\n        }\n      }\n    }\n  }\n}\n"}' --compressed

🌎 Environment

Rollups 0.9.1

✔️ Possible solutions

Reverse the order of the siblings.