-
Notifications
You must be signed in to change notification settings - Fork 199
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
Add limits for number of transactions by sender #1716
Merged
Merged
Changes from 32 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
2586fec
Remove eviction phase 1 (not necessary).
andreibancioiu a8642f2
Sketch config.
andreibancioiu 879add5
Fix initialization of mocks etc.
andreibancioiu 65b3c12
Sketch application of limits.
b0b1d0c
Fix build.
ae53ec5
Temporarily bypass application of limits.
dfdc4c4
Add type alias.
264c1ee
Sketch deduplication.
89e7113
Merge branch 'development' into pool++limits
edef44f
Fix deduplication logic.
a2efbd5
Fix some tests, remove unused code.
959d65b
Verify cache config. Extract interface. Add disabled cache (for criti…
e79c8ca
Fix tests.
c94bbfa
Merge branch 'development' into pool++limits
andreibancioiu 10f74e8
Fix remaining mock.
andreibancioiu 19e7eb1
Add some tests.
andreibancioiu d966ebd
Extra tests / coverage.
andreibancioiu e3d0dd4
Cover disabled cache.
andreibancioiu 51a5af4
Merge branch 'development' into pool++limits
andreibancioiu f4ffcab
Fix long test.
andreibancioiu 6c3a403
Add extra tests.
50c1f4f
Merge branch 'development' into pool++limits
andreibancioiu 636ad8b
Adjust order of magnitude for gas price.
andreibancioiu e9e4739
Extra log.
andreibancioiu ba3a4fe
Merge branch 'minor-fixes-scripts-trace' into pool++limits
andreibancioiu b3858ef
Fix ERD scale for score.
fc8c411
Merge branch 'development' into pool++limits
andreibancioiu 9c169a7
Remove log.
andreibancioiu 7f50aec
Fix after self review.
andreibancioiu 973f9e6
Merge branch 'development' into pool++limits
andreibancioiu 43b5701
Merge branch 'development' into pool++limits
andreibancioiu fa0294f
Merge branch 'development' into pool++limits
andreibancioiu 7240a23
Merge branch 'development' into pool++limits
LucianMincu 4761832
Merge branch 'development' into pool++limits
andreibancioiu 4d044bb
Fix after review.
andreibancioiu b63e42f
Merge branch 'development' into pool++limits
andreibancioiu b488b4d
Fix after review, plus fix tests to use the correct Equals() function.
andreibancioiu aa26f11
Merge branch 'development' into pool++limits
andreibancioiu 87dc724
Merge branch 'development' into pool++limits
andreibancioiu 48e3573
Merge branch 'development' into pool++limits
LucianMincu 4dcb960
Merge branch 'development' into pool++limits
LucianMincu 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
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
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,16 @@ | ||
package txpool | ||
|
||
import ( | ||
"github.com/ElrondNetwork/elrond-go/storage" | ||
"github.com/ElrondNetwork/elrond-go/storage/txcache" | ||
) | ||
|
||
type txCache interface { | ||
iulianpascalau marked this conversation as resolved.
Show resolved
Hide resolved
|
||
storage.Cacher | ||
|
||
AddTx(tx *txcache.WrappedTransaction) (ok bool, added bool) | ||
GetByTxHash(txHash []byte) (*txcache.WrappedTransaction, bool) | ||
RemoveTxByHash(txHash []byte) error | ||
CountTx() int64 | ||
ForEachTransaction(function txcache.ForEachTransaction) | ||
} |
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
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
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
Oops, something went wrong.
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.
what size does TxPoolMinSizeInBytes refer to?
if it is the size of a transaction then it is fine, although name is confusing, if it refers to the size of the pool itself then I don't think the condition is entirely correct, unless the minimum size we want for txpool is one tx.
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.
TxPoolMinSizeInBytes
is (was) ~ 40kb, and added mostly to ensure that there are no zeros (just positives) in the configuration. This was an arbitrary number to account for the size in bytes of one transaction, indeed (like 1 was used for counts / num shards and so on).Fixed to remove ambiguity, and now we use a simple condition for "strictly positive".