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

Improve TX receipt processing in IMA Agent for TX receipts with errors #13

Open
sergiy-skalelabs opened this issue Nov 13, 2023 · 0 comments
Assignees
Labels

Comments

@sergiy-skalelabs
Copy link
Contributor

sergiy-skalelabs commented Nov 13, 2023

TX receipt can be error and IMA Agent must understand it explicitly in order to print more friendly messages into text log. Here is example:

2023-11-13 16:55:17.779: MessageProxy(0xd2AAa00100000000000000000000000000000000).postIncomingMessages Done, TX was sgx-signed-and-sent, receipt is {"error":"processing response error (body=\"0x7b226572726f72223a7b22636f6465223a2d33323030342c226d657373616765223a2250656e64696e67207472616e73616374696f6e20776974682073616d65206e6f6e636520616c7265616479206578697374732028736b616c653a2077652069676e6f726520676173207072696365292e227d2c226964223a34362c226a736f6e727063223a22322e30227d\", error={\"code\":-32004}, requestBody=\"{\\\"method\\\":\\\"eth_sendRawTransaction\\\",\\\"params\\\":[\\\"0xf9041104843b9aca008304caac94d2aaa0010000000000000000000000000000000080b903a4603e5d13000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000140188f04f07518d8ed2dc05d78d523665aded0285459d19166d393d494dacbeeea062b99d05f0bb83bf18350bd1610d95cbe4e69317bc89e01ed96674f6c7f747a2b0c70403655c8959c4d01a277f63deebcbd29a74c8f6955fe978da56947f1a82c79d7157aec53c855c155a9cbeaaae765c3f14096362ef355fa6b5a76a6ca15000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000067861766965720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000140000000000000000000000000d2aaa00500000000000000000000000000000000000000000000000000000000d2aaa005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000115acd862ec793ad13fbe79778a6d5b77d5bc50000000000000000000000000e4298deeef37fa2e5086e3cd3cdf000a8fa4c97e00000000000000000000000000000000000000000000000000000000000003e8000000000000000000000000d2aaa00500000000000000000000000000000000000000000000000000000000d2aaa005000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000020000000000000000000000005f0d0d8c15469eb3291d60e9171d3478997401a8000000000000000000000000e4298deeef37fa2e5086e3cd3cdf000a8fa4c97e00000000000000000000000000000000000000000000000000000000000003e8870e28bfdbb9beaea0480374c3ced7672df411d566e347a2346f6da8ca11b42bb1b4c69ea59ad31eb3a0461f12d700649953f816d67e9469b77690aa8224b9fab044d7234a09531baf2f\\\"],\\\"id\\\":46,\\\"jsonrpc\\\":\\\"2.0\\\"}\", requestMethod=\"POST\", url=\"http://127.0.0.1:10003\", code=SERVER_ERROR, version=web/5.7.1)"}
2023-11-13 16:55:17.780: MessageProxy(0xd2AAa00100000000000000000000000000000000).postIncomingMessages WARNING:  TX stats computation error invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.7.0), stack is: 
Error: invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.7.0)
    --> Logger.makeError (/ima/npms/skale-owasp/node_modules/@ethersproject/logger/lib/index.js:238:21)
    --> Logger.throwError (/ima/npms/skale-owasp/node_modules/@ethersproject/logger/lib/index.js:247:20)
    --> Logger.throwArgumentError (/ima/npms/skale-owasp/node_modules/@ethersproject/logger/lib/index.js:250:21)
    --> BigNumber.from (/ima/npms/skale-owasp/node_modules/@ethersproject/bignumber/lib/bignumber.js:239:23)
    --> Module.toBN (/ima/npms/skale-owasp/owaspUtils.mjs:807:43)
    --> Module.payedCall (/ima/npms/skale-ima/imaTx.mjs:443:39)
    --> process.processTicksAndRejections (internal/process/task_queues:95:5)
    --> async callbackAllMessagesSign (/ima/npms/skale-ima/index.mjs:729:9)
    --> async Object.fn (/ima/npms/skale-ima/index.mjs:844:25)

Example above may lead to misunderstanding and let user to recognize problem as some wrong Big Number is specified in payed contract call. But real problem is different. It's non working skaled described by field code=SERVER_ERROR and header text in "error":"processing response error.... IMA Agent must detect such errors and print more friendly error messages with more easy recognizable error description.

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

No branches or pull requests

1 participant