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

add : check for commit span in apply bor message #1060

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion consensus/bor/statefull/processor.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package statefull

import (
"bytes"
"context"
"math"
"math/big"
Expand Down Expand Up @@ -90,7 +91,11 @@ func ApplyMessage(

success := big.NewInt(5).SetBytes(ret)

if success.Cmp(big.NewInt(0)) == 0 {
validatorContract := common.HexToAddress(chainConfig.Bor.ValidatorContract)

// if success == 0 and msg.To() != validatorContractAddress, log Error
// if msg.To() == validatorContractAddress, its committing a span and we don't get any return value
if success.Cmp(big.NewInt(0)) == 0 && !bytes.Equal(msg.To().Bytes(), validatorContract.Bytes()) {
log.Error("message execution failed on contract", "msgData", msg.Data)
}

Expand Down
Loading