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

Sporadic failures of TestBTCStakingTestSuite/Test8BTCDelegationFeeGrantTyped e2e test #693

Open
KonradStaniec opened this issue Jul 5, 2024 · 1 comment

Comments

@KonradStaniec
Copy link
Contributor

https://app.circleci.com/pipelines/github/babylonchain/babylon/2759/workflows/5a560144-469d-439b-982b-601a0bd4ee04/jobs/6507

@KonradStaniec
Copy link
Contributor Author

Some initial investigation.

For each broadcasted transaction, response is printed using PrintProto function which first marshalls given message to json and later convert it to yaml using yaml.JSONToYAML(out) conversion (from package "sigs.k8s.io/yaml")

Problem arise if marshalled json contrain control characters. Then conversion will return an error:

yaml: control characters are not allowed

In one of the failed tests, response from node is:

{
  "height": "0",
  "txhash": "2ACF964F1DA8937764352ABC02C5B53E7ADDDF6E659D3FD3870B13F773BD4B75",
  "codespace": "sdk",
  "code": 38,
  "data": "",
  "raw_log": "��[�o\u001b��r�\\\f�(�W\u001a��Y does not allow to pay fees for \r�7���r�T�3۸�I\u0006#�V~: fee-grant not found: not found",
  "logs": [],
  "info": "",
  "gas_wanted": "0",
  "gas_used": "0",
  "tx": null,
  "timestamp": "",
  "events": []
}

calling JSONToYAML will fail for this paylonad due to control character in raw_log field.

This control characters are there due to the fact, that ante handler which checks for fee grants returns direct byte addresses instead of bech32 encoded strings - https://github.com/cosmos/cosmos-sdk/blob/main/x/auth/ante/fee.go#L101

Conclusion:

  1. This is bug on the side of cosmos-sdk. Either conversion JSONToYAML should properly handle conversion with control characters or all returned errors should be properly encoded strings and not random byte arrays. Imo it should be the second option.

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

1 participant