rusty-kaspa icon indicating copy to clipboard operation
rusty-kaspa copied to clipboard

implement rpc method that fetches fee per mass based on block template

Open biryukovmaxim opened this issue 1 year ago • 3 comments

handler builds block template and calculates max/min/median values closes #501

biryukovmaxim avatar Jul 03 '24 08:07 biryukovmaxim

This API call should track the last request timestamp and return a cached value if this timestamp is within some threshold range (like 1 second). Due to the potential high frequency of this call invocation (easily a few thousand requests per second), we want to save compute and return the last calculated value.

aspect avatar Jul 04 '24 11:07 aspect

The term used here is "Priority" fee, but the actual calculation is done over real fees in the mempool.

I renamed the method name. should be more clear now

biryukovmaxim avatar Jul 09 '24 16:07 biryukovmaxim

  1. How does a developer use these figures? Create their TX, calculate its mass and then calculate their fee by multiplying the mass and the min, mid, max figures they get here?
  1. mempool total mass represents network load. Based on it dev will pick min/mid/max/0 value. Multiply it by tx mass
  2. it's in sompi. Could be micro sompi if we want to not use floats or ratio: numerator and denominator

biryukovmaxim avatar Jul 10 '24 05:07 biryukovmaxim