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

Fix the bug of Ostracon's changes of #194 #526

Merged
merged 1 commit into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
// Validation does not mutate state, but does require historical information from the stateDB,
// ie. to verify evidence from a validator at an old height.
func (blockExec *BlockExecutor) ValidateBlock(state State, round int32, block *types.Block) error {
return validateBlock(state, round, block)
err := validateBlock(state, round, block)
if err != nil {
return err
}
return blockExec.evpool.CheckEvidence(block.Evidence.Evidence)
}

// ApplyBlock validates the block against the state, executes it against the app,
Expand Down
7 changes: 6 additions & 1 deletion types/protobuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,19 @@ func (oc2pb) Header(header *Header) tmproto.Header {
LastCommitHash: header.LastCommitHash,
DataHash: header.DataHash,

VotersHash: header.VotersHash,
ValidatorsHash: header.ValidatorsHash,
NextValidatorsHash: header.NextValidatorsHash,
ConsensusHash: header.ConsensusHash,
AppHash: header.AppHash,
LastResultsHash: header.LastResultsHash,

EvidenceHash: header.EvidenceHash,
ProposerAddress: header.ProposerAddress,

// Ostracon fields
Round: header.Round,
Proof: header.Proof,
VotersHash: header.VotersHash,
}
}

Expand Down
3 changes: 2 additions & 1 deletion types/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ func (v *Validator) String() string {
if v == nil {
return "nil-Validator"
}
return fmt.Sprintf("Validator{%v %v VP:%v A:%v}",
return fmt.Sprintf("Validator{%v %v VP:%v VW:%v A:%v}",
v.Address,
v.PubKey,
v.VotingPower,
v.VotingWeight,
v.ProposerPriority)
}

Expand Down