-
Notifications
You must be signed in to change notification settings - Fork 198
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 edge case of set scheduled SCRs at bootstrap #3742
Fix edge case of set scheduled SCRs at bootstrap #3742
Conversation
SebastianMarian
commented
Feb 1, 2022
- Fixed some misleading logs
- Fixed an edge case situation which wrongly set scheduled SCRs for the current block when a node starts in epoch
* Fixed an edge case situation which wrongly set scheduled SCRs for the current block when a node starts in epoch
Codecov Report
@@ Coverage Diff @@
## development #3742 +/- ##
===============================================
+ Coverage 74.21% 74.23% +0.02%
===============================================
Files 599 599
Lines 79186 79245 +59
===============================================
+ Hits 58766 58826 +60
+ Misses 15855 15854 -1
Partials 4565 4565
Continue to review full report at Codecov.
|
@@ -488,6 +488,15 @@ func (ste *scheduledTxsExecution) IsScheduledTx(txHash []byte) bool { | |||
return ok | |||
} | |||
|
|||
func getNumScheduledSCRs(mapScheduledSCRs map[block.Type][]data.TransactionHandler) int { |
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.
👍
for _, txHash := range mb.TxHashes { | ||
scheduledTxs[string(txHash)] = struct{}{} | ||
log.Debug("startInEpochWithScheduledDataSyncer.getScheduledTransactionHashesWithDestMe", "hash", txHash) |
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 is a little too much log.debug - please delete
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.
There is only for scheduled txs, if they exist, from one single block at bootstrap -> start in epoch. So, it is printed only once, but it helps for debugging if needed!
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.
ah. I missed that it is only start in epoch. alright.
…th-scheduled process, integrationTests, testscommon: fix total gas provided with scheduled SC calls
…crs-at-bootstrap' into fix-edge-case-of-set-scheduled-scrs-at-bootstrap
@@ -61,7 +61,7 @@ func (f *feeHandler) GetAccumulatedFees() *big.Int { | |||
// GetDeveloperFees returns the total accumulated developer fees | |||
func (f *feeHandler) GetDeveloperFees() *big.Int { | |||
f.mut.RLock() | |||
developerFees := f.developerFees | |||
developerFees := big.NewInt(0).Set(f.developerFees) |
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.
👍
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.
+1
@@ -61,7 +61,7 @@ func (f *feeHandler) GetAccumulatedFees() *big.Int { | |||
// GetDeveloperFees returns the total accumulated developer fees | |||
func (f *feeHandler) GetDeveloperFees() *big.Int { | |||
f.mut.RLock() | |||
developerFees := f.developerFees | |||
developerFees := big.NewInt(0).Set(f.developerFees) |
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.
+1
15eaa2c
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.
System test passed .
c00f579