Skip to content
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

bugFix/account-wrap-is-nil #1835

Merged
merged 11 commits into from
Jun 1, 2020
Merged

Conversation

sasurobert
Copy link
Contributor

the error is from stakingToPeer RemoveAccount call. Still missing a small piece of information - what is the main cause.

@@ -101,7 +103,7 @@ type journalEntryDataTrieUpdates struct {
// NewJournalEntryDataTrieUpdates outputs a new JournalEntryDataTrieUpdates implementation used to revert an account's data trie
func NewJournalEntryDataTrieUpdates(trieUpdates map[string][]byte, account baseAccountHandler) (*journalEntryDataTrieUpdates, error) {
if check.IfNil(account) {
return nil, ErrNilAccountHandler
return nil, fmt.Errorf("%w in NewJournalEntryAccount", ErrNilAccountHandler)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NewJournalEntryDataTrieUpdates

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@@ -165,7 +165,7 @@ func (stp *stakingToPeer) UpdateProtocol(body *block.Body, nonce uint64) error {
if len(data) == 0 {
err = stp.peerState.RemoveAccount(blsPubKey)
if err != nil {
return err
log.Debug("staking to protocol RemoveAccount error", "err", err, "blsPubKey", blsPubKey)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log.Error ? and "staking to protocol RemoveAccount failed" to avoid displaying twice "error" and "err"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will put to log.logiferror.

@@ -258,7 +258,7 @@ func (sc *scProcessor) ExecuteSmartContractTransaction(
var results []data.TransactionHandler
results, consumedFee, err = sc.processVMOutput(vmOutput, txHash, tx, acntSnd, vmInput.CallType)
if err != nil {
log.Trace("process vm output error", "error", err.Error())
log.Trace("process vm output returned with problem ", "err", err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be log.Debug ? and "process vm output failed" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need. for any sc fail you would get a lot of messages. which are not needed.

@@ -471,7 +467,7 @@ func (s *stakingAuctionSC) registerBLSKeys(
) ([][]byte, error) {
maxNodesToRun := big.NewInt(0).SetBytes(args[0]).Uint64()
if uint64(len(args)) < maxNodesToRun+1 {
log.Debug("not enough arguments to process stake function")
s.eei.AddReturnMessage("not enough arguments to process stake function")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use the same pattern used in this file:
s.eei.AddReturnMessage(fmt.Sprintf("not enough arguments to process stake function: expected min %d, got %d", maxNodesToRun+1, len(args)))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@LucianMincu LucianMincu added the type:bug Something isn't working label Jun 1, 2020
@iulianpascalau iulianpascalau changed the base branch from master to release-candidate June 1, 2020 13:28
data/state/accountsDB.go Show resolved Hide resolved
process/coordinator/process.go Show resolved Hide resolved
Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@LucianMincu LucianMincu merged commit 56e4c0c into release-candidate Jun 1, 2020
@LucianMincu LucianMincu deleted the bugFix/account-wrap-is-nil branch June 1, 2020 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants