-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fix for duplicatiing transactions (IS-869) #1687
Conversation
SUGGESTIONS BEFORE MERGE:
|
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.
Please specify in detail how the fix was tested.
Also please add comments to the code describing the fix
…network/skaled into bug/IS-869-transaction-duplicates
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.
Please check the case if there is a single invalid transaction in the block.
libethereum/Client.cpp
Outdated
@@ -654,7 +656,7 @@ size_t Client::syncTransactions( | |||
RevertableFSPatch::lastBlockTimestamp = blockChain().info().timestamp(); | |||
StorageDestructionPatch::lastBlockTimestamp = blockChain().info().timestamp(); | |||
POWCheckPatch::lastBlockTimestamp = blockChain().info().timestamp(); | |||
|
|||
SkipInvalidTransactionsPatch::setLastBlock( blockChain().info() ); |
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.
Please follow the logic of other patches above - the code needs to be consistent
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.
It seems bad idea to stick just to timestamps - in general, patches can have different logic of activation. E.g. see AmsterdamFixPatch.
class SkipInvalidTransactionsPatch : public SchainPatch { | ||
public: | ||
static void init( const dev::eth::ChainParams& cp ) { | ||
activationTimestamp = cp.sChain.skipInvalidTransactionsPatchTimestamp; |
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.
Please add setter and print logs as other patch
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.
It seems bad idea to just stick to timestamp-only approach. Different patches can have different logic of activation. E.g. see AmsterdamFixPatch
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.
Please check the case if there is a single invalid transaction in the block.
Case of single invalid transaction in block is checked in test/unittests/libethereum/SkaleHost.cpp |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #1687 +/- ##
===========================================
+ Coverage 44.89% 45.24% +0.35%
===========================================
Files 347 349 +2
Lines 51283 51405 +122
===========================================
+ Hits 23023 23260 +237
+ Misses 28260 28145 -115 |
Fixes https://github.com/skalenetwork/internal-support/issues/869
Tests: