Background
The mpool replace --auto command currently hardcodes REPLACE_BY_FEE_RATIO_DEFAULT when computing the RBF minimum premium floor via compute_rbf. If a node is configured with a non-default replace_by_fee_ratio, the auto replacement can underbid and be rejected with GasPriceTooLow.
Required work
-
Implement MpoolGetConfig RPC — expose the node's mpool configuration (including replace_by_fee_ratio) over the API, matching the Lotus MpoolGetConfig interface.
-
Use runtime RBF ratio in mpool replace --auto — in src/cli/subcommands/mpool_cmd.rs, retrieve the replace_by_fee_ratio from MpoolGetConfig before calling compute_rbf, and pass the runtime value instead of REPLACE_BY_FEE_RATIO_DEFAULT so the auto replacement floor matches the running node's mpool configuration.
References
/cc @sudo-shashank
Background
The
mpool replace --autocommand currently hardcodesREPLACE_BY_FEE_RATIO_DEFAULTwhen computing the RBF minimum premium floor viacompute_rbf. If a node is configured with a non-defaultreplace_by_fee_ratio, the auto replacement can underbid and be rejected withGasPriceTooLow.Required work
Implement
MpoolGetConfigRPC — expose the node's mpool configuration (includingreplace_by_fee_ratio) over the API, matching the Lotus MpoolGetConfig interface.Use runtime RBF ratio in
mpool replace --auto— insrc/cli/subcommands/mpool_cmd.rs, retrieve thereplace_by_fee_ratiofromMpoolGetConfigbefore callingcompute_rbf, and pass the runtime value instead ofREPLACE_BY_FEE_RATIO_DEFAULTso the auto replacement floor matches the running node's mpool configuration.References
MpoolGetConfigAPI docs: https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-methods-v1-stable.md#MpoolGetConfignonce-fixandreplacempool tools #7084 (comment Addnonce-fixandreplacempool tools #7084 (comment))/cc @sudo-shashank