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

🐛 Tallying non-zero exit codes gives wrong result #446

Open
Thomasvdam opened this issue Dec 13, 2024 · 2 comments
Open

🐛 Tallying non-zero exit codes gives wrong result #446

Thomasvdam opened this issue Dec 13, 2024 · 2 comments
Labels
priority: critical Must be fixed immediately type: bug 🐛 Something isn't working

Comments

@Thomasvdam
Copy link
Member

Thomasvdam commented Dec 13, 2024

🐛 Bug Report

Thinking a little more I'm pretty sure this actually has to do with determining consensus/outcomes for non-zero exit codes.


When tallying reveals for executions that ran out of gas the chain incorrectly returns a failed to apply filter error.

See https://devnet.test.explorer.seda.xyz/data-requests/d5d6d3dd1f41f6e23bd7a35c54bf85a2efd45d9c926c4845beb9c8441f8b4bfc/2394 for an example

Steps to Reproduce

Post a DR with a low exec_gas_limit.

Code snippet to reproduce

{
  "post_data_request": {
    "posted_dr": {
      "memo": "Z1xTzA==",
      "version": "0.0.1",
      "gas_price": "1000",
      "exec_inputs": "ZXRoLXVzZGM=",
      "tally_inputs": "",
      "exec_gas_limit": 100000,
      "exec_program_id": "57ce7bf6a9fdf1782dbc1e709418bd22603797b202453f0c49186bbb60f4b5e4",
      "tally_gas_limit": 100000,
      "consensus_filter": "AA==",
      "tally_program_id": "57ce7bf6a9fdf1782dbc1e709418bd22603797b202453f0c49186bbb60f4b5e4",
      "replication_factor": 1
    },
    "seda_payload": "",
    "payback_address": "c2VkYV9zb2x2ZXI="
  }
}

Stack trace & error message

failed to apply filter

Expected Behavior

If all reveals are non-zero we can still have consensus; it's just that the outcome is an error.

Your Environment

  • Chain version: v0.4.0-dev.10
@Thomasvdam Thomasvdam added type: bug 🐛 Something isn't working priority: critical Must be fixed immediately labels Dec 13, 2024
@Thomasvdam Thomasvdam changed the title 🐛 Tallying out-of-gas reveals gives wrong result 🐛 Tallying non-zero exit codes gives wrong result Dec 13, 2024
@hacheigriega
Copy link
Member

hacheigriega commented Dec 16, 2024

Perhaps #439 simplified the error messages assigned to the data results too much. Testing using the new integration testing, I suspect the base error was "> 1/3 of reveals are corrupted" here. Since 1 out of 1 reveal had a non-zero exit code, ApplyFilter() returned an error and tally VM was not executed. When tally VM is not executed, the consensus is always false as described here (Corrupt reveals error is distinct from no consensus error). Looks like we will have to modify the filtering logic.

@Thomasvdam
Copy link
Member Author

We agreed to take time this week to work on the entire tally specification including rewards so we can pick these issues up together. We'll update the Notion document (or create a new one) with a flowchart detailing the various states that can come into the tally state machine, the checks it should do, and the outcome we expect in terms of consensus, exit codes, and payouts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: critical Must be fixed immediately type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants