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

[BUG] Invalid transaction error message when payment amount exceeds gas lane limits #5033

Open
devendran-m opened this issue Dec 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@devendran-m
Copy link
Contributor

Description:
When submitting a WASM-based transaction with "classic" payment, if the payment-amount exceeds the highest gas lane limit, the transaction fails with a generic error message:

{"code":-32016,"message":"Invalid transaction","data":"the transaction was invalid: The transaction sent to the network was invalid for an unspecified reason"}

The current error message lacks clarity and does not explain that the failure occurs because the payment amount cannot be assigned to an existing gas lane.

Steps to Reproduce:

  1. Use the following chainspec configuration:
{"era_duration":"10 minutes","gas_hold_interval":"5 minutes","enable_addressable_entity":true}
  1. Submit a transaction with the following parameters:
casper-client put-transaction package \
--chain-name casper-test-jh \
-n http://172.31.27.77:7777 \
--package-address package-10314994ca14feddc562fe63c7407f750c6f81a0ced65e0e33c0ad63fcbe0281 \
--session-entry-point apple \
--payment-amount 500000000000 \
--pricing-mode classic \
--gas-price-tolerance 2 \
--standard-payment true \
--secret-key /home/ubuntu/keys/test0/secret_key.pem
  1. Observe the returned error:
{"code":-32016,"message":"Invalid transaction","data":"the transaction was invalid: The transaction sent to the network was invalid for an unspecified reason"}

Expected Behaviour:
The error message should clearly explain that the transaction failed because the payment-amount exceeded the largest available gas lane.

Actual Behaviour:
A vague error message is returned, making debugging difficult

Environment Details:

casper-node: 61b78eabc52e1de3489c5652810dc030a1a5743f
casper-sidecar: 359792250d1f4d998a347546b8205cac15c86bd6
casper-client: 2e4bfcdda1d699a60183631cb619371d5c2f5d51

Related PR/Changes:
Recent change (merged on Dec 15) that modifies behavior around gas lane determination for classic payment.

Additional Context:
Reported by Jiuhong during testing. Confirmed by Jakub that the issue arises when the payment exceeds the largest gas lane limit (100000000000).

Acceptance Criteria:

  • The error message clearly specifies that the payment amount exceeds the allowable gas lane limit.
  • The change is reflected in casper-node and/or casper-sidecar logs and responses.
  • A test case is added to verify this scenario.
@devendran-m devendran-m added the bug Something isn't working label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant