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

Change ordering of TXs by time #1613

Merged
merged 6 commits into from
Jan 3, 2023
Merged

Change ordering of TXs by time #1613

merged 6 commits into from
Jan 3, 2023

Conversation

Bushstar
Copy link
Member

When looping over TXs to add to the block loop over them by time ordering.

@@ -510,7 +510,7 @@ void SetupServerArgs()
gArgs.AddArg("-regtest-minttoken-simulate-mainnet", "Simulate mainnet for minttokens on regtest - default behavior on regtest is to allow anyone to mint mintable tokens for ease of testing", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::OPTIONS);
gArgs.AddArg("-simulatemainnet", "Configure the regtest network to mainnet target timespan and spacing ", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::OPTIONS);
gArgs.AddArg("-dexstats", strprintf("Enable storing live dex data in DB (default: %u)", DEFAULT_DEXSTATS), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-blockfeeordering", strprintf("Whether to order transactions by fee, otherwise ordered by time (default: %u)", DEFAULT_FEE_ORDERING), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-blocktimeordering", strprintf("Whether to order transactions by time, otherwise ordered by fee (default: %u)", DEFAULT_FEE_ORDERING), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use fee as default? I thought the default should be time to prevent frontrunning. @prasannavl

Copy link
Member

@prasannavl prasannavl Jan 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed this earlier. It's because fee is quite an intricate part of quite a few things, including fee estimation and many things that rely on this behaviour.

In order to avoid surprises, and also since this is a new behaviour, would be best to let it be used optionally for a while, before considering it as default.

The front-running aspects will be prevented as more and more MNs start using this, which we can expect as more and more community starts opting into this behaviour.

@Bushstar Bushstar merged commit 704c383 into master Jan 3, 2023
@Bushstar Bushstar deleted the miner-loop-on-time branch January 3, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants