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

Overflow of valid fee value #103

Open
mn13 opened this issue Mar 12, 2024 · 2 comments
Open

Overflow of valid fee value #103

mn13 opened this issue Mar 12, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@mn13
Copy link

mn13 commented Mar 12, 2024

What version are you using?

v20.3.3

What did you do?

With soroban 20.3.1 I tried to call soroban contract install with a 61 kb wasm in testnet and got error: Fee was too large 4946582915. After some investigation I found that error occurs in https://github.com/stellar/soroban-rpc/blob/main/cmd/crates/soroban-rpc/src/txn.rs#L321 because classic_tx_fee + simulation.min_resource_fee = 4946582915 or 494.6582915 XLM.
Why values that exceed U32_MAX is not allowed for fee? Does it mean that there is no way to install wasm in mainnet with soroban-cli?

What did you expect to see?

Max fee value fits I128_MAX

What did you see instead?

Error if simulation.min_resource_fee is more than U32_MAX - DEFAULT_TRANSACTION_FEES=4294967195

@mn13 mn13 added the bug Something isn't working label Mar 12, 2024
@mn13
Copy link
Author

mn13 commented Mar 12, 2024

Looks like the problem came from https://github.com/stellar/stellar-xdr

pub struct Transaction {
    pub source_account: MuxedAccount,
    pub fee: u32,
    pub seq_num: SequenceNumber,
    pub cond: Preconditions,
    pub memo: Memo,
    pub operations: VecM<Operation, 100>,
    pub ext: TransactionExt,
}

@mn13
Copy link
Author

mn13 commented Mar 12, 2024

As described in stellar-xdr repository:
Types are generated from XDR definitions hosted at stellar/stellar-xdr using xdrgen.

And u32 fees are part of xdr definitions

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