-
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
Merge Development into feat/scheduled-sc-execution plus some gas fix #3705
Merge Development into feat/scheduled-sc-execution plus some gas fix #3705
Conversation
# Conflicts: # cmd/node/config/enableEpochs.toml # node/nodeRunner.go
# Conflicts: # cmd/node/config/enableEpochs.toml # config/epochConfig.go # node/nodeRunner.go
Jailed node should be unstaked if enough validators
get from cache when taking snapshot
# Conflicts: # storage/pruning/pruningStorer.go # storage/pruning/pruningStorer_test.go # testscommon/trie/snapshotPruningStorerStub.go
Arwen 1.4.34
…rrect shard header
…m:ElrondNetwork/elrond-go into merge-snapshot-improvement-feat-scheduled
4119ca9
…d and refunded * Added more logs
…e than max gas accepted in txs dest me (in this case at least one mini block should be accepted, otherwise the shard will be stuck with processing at the current meta block)
@@ -1362,15 +1403,15 @@ func (txs *transactions) ProcessMiniBlock( | |||
return processedTxHashes, index, err | |||
} | |||
|
|||
gasProvidedByTxInSelfShard, errComputeGas := txs.computeGasProvided( | |||
gasProvidedByTxInSelfShard, err = txs.computeGasProvided( |
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.
👍
missed that
a9b7da3
|
||
for index := range miniBlockScrs { | ||
if !haveTime() { | ||
err = process.ErrTimeIsOut | ||
return processedTxHashes, index, err | ||
} | ||
|
||
gasProvidedByTxInSelfShard, errComputeGas := scr.computeGasProvided( | ||
gasProvidedByTxInSelfShard, err = scr.computeGasProvided( |
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 main reason that using defer function that handles an internal err variable is a bad practice.
This should have been split in at least 3 functions:
scr.processSomethingWithoutErrHandling()
err := scr.processOtherStuffWithErrHandling()
scr.handleErr(err)
In this way the intent will be better shown and the code would have been more robust
We should stop writing code like this and refactor wherever we can this.
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.
👍
53f5824
No description provided.