-
Notifications
You must be signed in to change notification settings - Fork 490
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
shuffle pending accounts in the transaction pool #501
Conversation
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.
Should we also propose this change in geth?
@JekaMas can you please look into the CI failure? |
} | ||
|
||
// ShuffleMap returns a shuffled slice of keys to iterate by | ||
func ShuffleMap[K comparable, V any](m map[K]V) []K { |
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.
This isn't deterministically random I guess?
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.
As far as it uses crypto/rand, it isn't.
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.
This looks like a good explanation: https://stackoverflow.com/a/55925880
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.
Yeap, although it only depends on non cryptographically strong hash and a seed. The PR introduces cryptographically strong solution.
@JekaMas Can you please have a look at the CI ? Thank you ! |
@JekaMas CI is failing. Can you please look into this? |
I believe, we need to rethink whole idea of random ordering of transactions - ethereum/go-ethereum#21350 |
Will redo with proving tests. |
Prevents possible vulnerability with pre-mined accounts