Xahau / xahaud

Codebase for Xahaud - The consensus, RPC & blockchain app for the Xahau network.
https://xahau.network
ISC License
23 stars 11 forks source link

`base_fee_no_hooks` doesn't include any fees other than Hook fees.(Version: [2024.9.11-release+985]) #369

Open tequdev opened 4 days ago

tequdev commented 4 days ago

Issue Description

The base_fee_no_hooks field included in the return value of the fee command does not include fees other than Hooks fees, such as dynamic fees for Memo fields.

https://github.com/Xahau/xahaud/blob/79d83bd424db07a51fa3d1ea41a01ecfdf7af99c/src/ripple/app/misc/impl/TxQ.cpp#L2079

This is an issue that is not urgent, but I will keep a note of it.

Steps to Reproduce

import { Client, encode } from '@transia/xrpl'

const client = new Client('wss://xahau.org')

const main = async () => {
  await client.connect()

  const tx_json = {
    TransactionType: 'AccountSet',
    Account: 'rQQQrUdN1cLdNmxH4dHfKgmX5P4kf3ZrM',
    Fee: '0',
    SigningPubKey: '',
    Sequence: 0,
    Memos: [{ Memo: { MemoType: '0101', MemoData: '10000000000000000000000000000000000000' } }],
  }

  const tx_blob = encode(tx_json)

  const response = await client.request({
    command: 'fee',
    tx_blob,
  })
  console.log(response.result)
  await client.disconnect()
}
main()

result

{
  current_ledger_size: '13',
  current_queue_size: '0',
  drops: {
    base_fee: '31',
    base_fee_no_hooks: '10',
    median_fee: '15500',
    minimum_fee: '31',
    open_ledger_fee: '31'
  },
  expected_ledger_size: '330',
  fee_hooks_feeunits: '31',
  ledger_current_index: 8807447,
  levels: {
    median_level: '128000',
    minimum_level: '256',
    open_ledger_level: '256',
    reference_level: '256'
  },
  max_queue_size: '6600'
}

Expected Result

It includes all fees other than Hooks execution fees.

 base_fee_no_hooks: '31',

Actual Result

base_fee_no_hooks: '10',

Environment

Version: 2024.9.11-release+985

Supporting Files

dangell7 commented 4 days ago

Its improperly named I agree. The problem is, we cannot switch the field or every current client will break.

base_fee is the base + hooks + memos + hook parameters base_fee_no_hooks is just the base

We can rename it if you'd like