generated from flashbots/flashbots-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Min bid #274
Merged
Merged
Min bid #274
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
648040f
add min-bid feature
0818f35
Add Float to U256 test, other minor review changes
7d669d3
Re-wrote floatEthTo256Wei + addressed review comments
bfed807
Apply suggestions from jtraglia's code review
allboxes b36cefd
fix typo
f10d25c
Changed default min-bid to 0 and added logging
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package cli | ||
|
||
import ( | ||
"math/big" | ||
"testing" | ||
|
||
"github.com/flashbots/go-boost-utils/types" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestFloatEthTo256Wei(t *testing.T) { | ||
// test with small input | ||
i := 0.000000000000012345 | ||
weiU256, err := floatEthTo256Wei(i) | ||
require.NoError(t, err) | ||
allboxes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
require.Equal(t, types.IntToU256(12345), *weiU256) | ||
|
||
// test with zero | ||
i = 0 | ||
weiU256, err = floatEthTo256Wei(i) | ||
require.NoError(t, err) | ||
require.Equal(t, types.IntToU256(0), *weiU256) | ||
|
||
// test with large input | ||
i = 987654.3 | ||
weiU256, err = floatEthTo256Wei(i) | ||
require.NoError(t, err) | ||
|
||
r := big.NewInt(9876543) | ||
r.Mul(r, big.NewInt(1e17)) | ||
referenceWeiU256 := new(types.U256Str) | ||
err = referenceWeiU256.FromBig(r) | ||
require.NoError(t, err) | ||
|
||
require.Equal(t, *refernceWeiU256, *weiU256) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing, the default minimum bid should be zero. It's up to the user (operator) to set this value based on their preferences. I'm just concerned with the side effects of this. For example, a default value of
0.001
would affect testnets (like sepolia) where the average mev reward is most likely to be below that threshold. I understand the desire for a non-zero default: low value blocks will be built using the local execution engine. But when CL clients start to compare the value to the block it built locally, I think that would serve as a better "default" minimum.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that makes sense.