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

Revert block.Evidence to nested block.Evidence.Evidence #136

Merged
merged 1 commit into from
May 15, 2023
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
2 changes: 1 addition & 1 deletion internal/consensus/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func decideProposal(

address := pubKey.Address()
polRound, propBlockID := validRound, types.BlockID{Hash: block.Hash(), PartSetHeader: blockParts.Header()}
proposal = types.NewProposal(height, round, polRound, propBlockID, block.Header.Time, block.GetTxKeys(), block.Header, block.LastCommit, block.Evidence, address)
proposal = types.NewProposal(height, round, polRound, propBlockID, block.Header.Time, block.GetTxKeys(), block.Header, block.LastCommit, block.Evidence.Evidence, address)
p := proposal.ToProto()
require.NoError(t, vs.SignProposal(ctx, chainID, p))

Expand Down
2 changes: 1 addition & 1 deletion internal/consensus/pbts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (p *pbtsTestHarness) nextHeight(ctx context.Context, t *testing.T, proposer
ps, err := b.MakePartSet(types.BlockPartSizeBytes)
require.NoError(t, err)
bid := types.BlockID{Hash: b.Hash(), PartSetHeader: ps.Header()}
prop := types.NewProposal(p.currentHeight, 0, -1, bid, proposedTime, b.GetTxKeys(), b.Header, b.LastCommit, b.Evidence, k.Address())
prop := types.NewProposal(p.currentHeight, 0, -1, bid, proposedTime, b.GetTxKeys(), b.Header, b.LastCommit, b.Evidence.Evidence, k.Address())
tp := prop.ToProto()

if err := proposer.SignProposal(ctx, p.observedState.state.ChainID, tp); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/consensus/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ func TestReactorWithEvidence(t *testing.T) {
}

block := msg.Data().(types.EventDataNewBlock).Block
require.Len(t, block.Evidence, 1)
require.Len(t, block.Evidence.Evidence, 1)
}(sub)
}

Expand Down
8 changes: 4 additions & 4 deletions internal/consensus/replay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func setupSimulator(ctx context.Context, t *testing.T) *simulatorTestSuite {

pubKey, err := vss[1].PrivValidator.GetPubKey(ctx)
require.NoError(t, err)
proposal := types.NewProposal(vss[1].Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence, pubKey.Address())
proposal := types.NewProposal(vss[1].Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence.Evidence, pubKey.Address())
p := proposal.ToProto()
if err := vss[1].SignProposal(ctx, cfg.ChainID(), p); err != nil {
t.Fatal("failed to sign bad proposal", err)
Expand Down Expand Up @@ -423,7 +423,7 @@ func setupSimulator(ctx context.Context, t *testing.T) *simulatorTestSuite {
blockID = types.BlockID{Hash: propBlock.Hash(), PartSetHeader: propBlockParts.Header()}
pubKey, err = vss[2].PrivValidator.GetPubKey(ctx)
require.NoError(t, err)
proposal = types.NewProposal(vss[1].Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence, pubKey.Address())
proposal = types.NewProposal(vss[1].Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence.Evidence, pubKey.Address())
p = proposal.ToProto()
if err := vss[2].SignProposal(ctx, cfg.ChainID(), p); err != nil {
t.Fatal("failed to sign bad proposal", err)
Expand Down Expand Up @@ -487,7 +487,7 @@ func setupSimulator(ctx context.Context, t *testing.T) *simulatorTestSuite {
require.NotEqual(t, -1, selfIndex)
pubKey, err = vss[3].PrivValidator.GetPubKey(ctx)
require.NoError(t, err)
proposal = types.NewProposal(vss[3].Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence, pubKey.Address())
proposal = types.NewProposal(vss[3].Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence.Evidence, pubKey.Address())
p = proposal.ToProto()
if err := vss[3].SignProposal(ctx, cfg.ChainID(), p); err != nil {
t.Fatal("failed to sign bad proposal", err)
Expand Down Expand Up @@ -560,7 +560,7 @@ func setupSimulator(ctx context.Context, t *testing.T) *simulatorTestSuite {
require.NotEqual(t, -1, selfIndex)
pubKey, err = vss[1].PrivValidator.GetPubKey(ctx)
require.NoError(t, err)
proposal = types.NewProposal(vss[1].Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence, pubKey.Address())
proposal = types.NewProposal(vss[1].Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence.Evidence, pubKey.Address())
p = proposal.ToProto()
if err := vss[1].SignProposal(ctx, cfg.ChainID(), p); err != nil {
t.Fatal("failed to sign bad proposal", err)
Expand Down
6 changes: 3 additions & 3 deletions internal/consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ func (cs *State) defaultDecideProposal(ctx context.Context, height int64, round

// Make proposal
propBlockID := types.BlockID{Hash: block.Hash(), PartSetHeader: blockParts.Header()}
proposal := types.NewProposal(height, round, cs.roundState.ValidRound(), propBlockID, block.Header.Time, block.GetTxKeys(), block.Header, block.LastCommit, block.Evidence, cs.privValidatorPubKey.Address())
proposal := types.NewProposal(height, round, cs.roundState.ValidRound(), propBlockID, block.Header.Time, block.GetTxKeys(), block.Header, block.LastCommit, block.Evidence.Evidence, cs.privValidatorPubKey.Address())
p := proposal.ToProto()

// wait the max amount we would wait for a proposal
Expand Down Expand Up @@ -1647,7 +1647,7 @@ func (cs *State) defaultDoPrevote(ctx context.Context, height int64, round int32
return
}
// We have full proposal block and txs. Build proposal block with txKeys
proposalBlock := cs.buildProposalBlock(height, block.Header, block.LastCommit, block.Evidence, block.ProposerAddress, txKeys)
proposalBlock := cs.buildProposalBlock(height, block.Header, block.LastCommit, block.Evidence.Evidence, block.ProposerAddress, txKeys)
if proposalBlock == nil {
cs.signAddVote(ctx, tmproto.PrevoteType, nil, types.PartSetHeader{})
return
Expand Down Expand Up @@ -2280,7 +2280,7 @@ func (cs *State) RecordMetrics(height int64, block *types.Block) {
byzantineValidatorsCount int64
)

for _, ev := range block.Evidence {
for _, ev := range block.Evidence.Evidence {
if dve, ok := ev.(*types.DuplicateVoteEvidence); ok {
if _, val := cs.roundState.Validators().GetByAddress(dve.VoteA.ValidatorAddress); val != nil {
byzantineValidatorsCount++
Expand Down
14 changes: 7 additions & 7 deletions internal/consensus/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func TestStateBadProposal(t *testing.T) {
blockID := types.BlockID{Hash: propBlock.Hash(), PartSetHeader: propBlockParts.Header()}
pubKey, err := vss[1].PrivValidator.GetPubKey(ctx)
require.NoError(t, err)
proposal := types.NewProposal(vs2.Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence, pubKey.Address())
proposal := types.NewProposal(vs2.Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence.Evidence, pubKey.Address())
p := proposal.ToProto()
err = vs2.SignProposal(ctx, config.ChainID(), p)
require.NoError(t, err)
Expand Down Expand Up @@ -298,7 +298,7 @@ func TestStateOversizedBlock(t *testing.T) {
blockID := types.BlockID{Hash: propBlock.Hash(), PartSetHeader: propBlockParts.Header()}
pubKey, err := vss[1].PrivValidator.GetPubKey(ctx)
require.NoError(t, err)
proposal := types.NewProposal(height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence, pubKey.Address())
proposal := types.NewProposal(height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence.Evidence, pubKey.Address())
p := proposal.ToProto()
err = vs2.SignProposal(ctx, config.ChainID(), p)
require.NoError(t, err)
Expand Down Expand Up @@ -808,7 +808,7 @@ func TestStateLock_POLRelock(t *testing.T) {
round++
pubKey, err := vss[0].PrivValidator.GetPubKey(ctx)
require.NoError(t, err)
propR1 := types.NewProposal(height, round, cs1.roundState.ValidRound(), blockID, theBlock.Header.Time, theBlock.GetTxKeys(), theBlock.Header, theBlock.LastCommit, theBlock.Evidence, pubKey.Address())
propR1 := types.NewProposal(height, round, cs1.roundState.ValidRound(), blockID, theBlock.Header.Time, theBlock.GetTxKeys(), theBlock.Header, theBlock.LastCommit, theBlock.Evidence.Evidence, pubKey.Address())
p := propR1.ToProto()
err = vs2.SignProposal(ctx, cs1.state.ChainID, p)
require.NoError(t, err)
Expand Down Expand Up @@ -1506,7 +1506,7 @@ func TestStateLock_POLSafety2(t *testing.T) {
// in round 2 we see the polkad block from round 0
pubKey, err := vss[0].PrivValidator.GetPubKey(ctx)
require.NoError(t, err)
newProp := types.NewProposal(height, round, 0, propBlockID0, propBlock0.Header.Time, propBlock0.GetTxKeys(), propBlock0.Header, propBlock0.LastCommit, propBlock0.Evidence, pubKey.Address())
newProp := types.NewProposal(height, round, 0, propBlockID0, propBlock0.Header.Time, propBlock0.GetTxKeys(), propBlock0.Header, propBlock0.LastCommit, propBlock0.Evidence.Evidence, pubKey.Address())
p := newProp.ToProto()
err = vs3.SignProposal(ctx, config.ChainID(), p)
require.NoError(t, err)
Expand Down Expand Up @@ -1647,7 +1647,7 @@ func TestState_PrevotePOLFromPreviousRound(t *testing.T) {
round++
pubKey, err := vss[1].PrivValidator.GetPubKey(ctx)
require.NoError(t, err)
propR2 := types.NewProposal(height, round, 1, r1BlockID, propBlockR1.Header.Time, propBlockR1.GetTxKeys(), propBlockR1.Header, propBlockR1.LastCommit, propBlockR1.Evidence, pubKey.Address())
propR2 := types.NewProposal(height, round, 1, r1BlockID, propBlockR1.Header.Time, propBlockR1.GetTxKeys(), propBlockR1.Header, propBlockR1.LastCommit, propBlockR1.Evidence.Evidence, pubKey.Address())
p := propR2.ToProto()
err = vs3.SignProposal(ctx, cs1.state.ChainID, p)
require.NoError(t, err)
Expand Down Expand Up @@ -3032,7 +3032,7 @@ func TestStateTimestamp_ProposalNotMatch(t *testing.T) {
// Create a proposal with a timestamp that does not match the timestamp of the block.
pubKey, err := vs2.PrivValidator.GetPubKey(ctx)
require.NoError(t, err)
proposal := types.NewProposal(vs2.Height, round, -1, blockID, propBlock.Header.Time.Add(time.Millisecond), propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence, pubKey.Address())
proposal := types.NewProposal(vs2.Height, round, -1, blockID, propBlock.Header.Time.Add(time.Millisecond), propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence.Evidence, pubKey.Address())
p := proposal.ToProto()
err = vs2.SignProposal(ctx, config.ChainID(), p)
require.NoError(t, err)
Expand Down Expand Up @@ -3082,7 +3082,7 @@ func TestStateTimestamp_ProposalMatch(t *testing.T) {
// Create a proposal with a timestamp that matches the timestamp of the block.
pubKey, err := vs2.PrivValidator.GetPubKey(ctx)
require.NoError(t, err)
proposal := types.NewProposal(vs2.Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence, pubKey.Address())
proposal := types.NewProposal(vs2.Height, round, -1, blockID, propBlock.Header.Time, propBlock.GetTxKeys(), propBlock.Header, propBlock.LastCommit, propBlock.Evidence.Evidence, pubKey.Address())
p := proposal.ToProto()
err = vs2.SignProposal(ctx, config.ChainID(), p)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion internal/evidence/pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func TestEvidencePoolUpdate(t *testing.T) {

require.Equal(t, uint32(3), pool.Size())

pool.Update(ctx, state, block.Evidence)
pool.Update(ctx, state, block.Evidence.Evidence)

// a) Update marks evidence as committed so pending evidence should be empty
evList, _ = pool.PendingEvidence(defaultEvidenceMaxBytes)
Expand Down
16 changes: 8 additions & 8 deletions internal/state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
MaxTxBytes: maxDataBytes,
Txs: block.Txs.ToSliceOfBytes(),
LocalLastCommit: buildExtendedCommitInfo(lastExtCommit, blockExec.store, state.InitialHeight, state.ConsensusParams.ABCI),
ByzantineValidators: block.Evidence.ToABCI(),
ByzantineValidators: block.Evidence.Evidence.ToABCI(),
Height: block.Height,
Time: block.Time,
NextValidatorsHash: block.NextValidatorsHash,
Expand Down Expand Up @@ -169,7 +169,7 @@ func (blockExec *BlockExecutor) ProcessProposal(
Time: block.Header.Time,
Txs: txs,
ProposedLastCommit: buildLastCommitInfo(block, blockExec.store, state.InitialHeight),
ByzantineValidators: block.Evidence.ToABCI(),
ByzantineValidators: block.Evidence.Evidence.ToABCI(),
ProposerAddress: block.ProposerAddress,
NextValidatorsHash: block.NextValidatorsHash,
AppHash: block.AppHash,
Expand Down Expand Up @@ -208,7 +208,7 @@ func (blockExec *BlockExecutor) ValidateBlock(ctx context.Context, state State,
return err
}

err = blockExec.evpool.CheckEvidence(ctx, block.Evidence)
err = blockExec.evpool.CheckEvidence(ctx, block.Evidence.Evidence)
if err != nil {
return err
}
Expand Down Expand Up @@ -254,7 +254,7 @@ func (blockExec *BlockExecutor) ApplyBlock(
Time: block.Header.Time,
Txs: txs,
DecidedLastCommit: buildLastCommitInfo(block, blockExec.store, state.InitialHeight),
ByzantineValidators: block.Evidence.ToABCI(),
ByzantineValidators: block.Evidence.Evidence.ToABCI(),
ProposerAddress: block.ProposerAddress,
NextValidatorsHash: block.NextValidatorsHash,
AppHash: block.AppHash,
Expand Down Expand Up @@ -337,7 +337,7 @@ func (blockExec *BlockExecutor) ApplyBlock(
}

// Update evpool with the latest state.
blockExec.evpool.Update(ctx, state, block.Evidence)
blockExec.evpool.Update(ctx, state, block.Evidence.Evidence)

// Update the app hash and save the state.
state.AppHash = fBlockRes.AppHash
Expand Down Expand Up @@ -711,8 +711,8 @@ func fireEvents(
logger.Error("failed publishing new block header", "err", err)
}

if len(block.Evidence) != 0 {
for _, ev := range block.Evidence {
if len(block.Evidence.Evidence) != 0 {
for _, ev := range block.Evidence.Evidence {
if err := eventBus.PublishEventNewEvidence(types.EventDataNewEvidence{
Evidence: ev,
Height: block.Height,
Expand Down Expand Up @@ -772,7 +772,7 @@ func ExecCommitBlock(
Time: block.Time,
Txs: block.Txs.ToSliceOfBytes(),
DecidedLastCommit: buildLastCommitInfo(block, store, initialHeight),
ByzantineValidators: block.Evidence.ToABCI(),
ByzantineValidators: block.Evidence.Evidence.ToABCI(),
AppHash: block.AppHash,
ValidatorsHash: block.ValidatorsHash,
ConsensusHash: block.ConsensusHash,
Expand Down
4 changes: 2 additions & 2 deletions internal/state/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ func TestFinalizeBlockByzantineValidators(t *testing.T) {
blockExec := sm.NewBlockExecutor(stateStore, log.NewNopLogger(), proxyApp, mp, evpool, blockStore, eventBus, sm.NopMetrics())

block := sf.MakeBlock(state, 1, new(types.Commit))
block.Evidence = ev
block.Evidence = types.EvidenceData{Evidence: ev}
block.Header.EvidenceHash = block.Evidence.Hash()
bps, err := block.MakePartSet(testPartSize)
require.NoError(t, err)
Expand Down Expand Up @@ -347,7 +347,7 @@ func TestProcessProposal(t *testing.T) {
Hash: block1.Hash(),
Height: block1.Header.Height,
Time: block1.Header.Time,
ByzantineValidators: block1.Evidence.ToABCI(),
ByzantineValidators: block1.Evidence.Evidence.ToABCI(),
ProposedLastCommit: abci.CommitInfo{
Round: 0,
Votes: voteInfos,
Expand Down
2 changes: 1 addition & 1 deletion node/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func TestCreateProposalBlock(t *testing.T) {

evList, size := evidencePool.PendingEvidence(state.ConsensusParams.Evidence.MaxBytes)
require.Less(t, size, state.ConsensusParams.Evidence.MaxBytes+1)
evData := types.EvidenceList(evList)
evData := &types.EvidenceData{Evidence: evList}
require.EqualValues(t, size, evData.ByteSize())

// fill the mempool with more txs
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/tests/evidence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ func TestEvidence_Misbehavior(t *testing.T) {
testnet := loadTestnet(t)
seenEvidence := 0
for _, block := range blocks {
if len(block.Evidence) != 0 {
seenEvidence += len(block.Evidence)
if len(block.Evidence.Evidence) != 0 {
seenEvidence += len(block.Evidence.Evidence)
}
}
require.Equal(t, testnet.Evidence, seenEvidence,
Expand Down
99 changes: 95 additions & 4 deletions types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type Block struct {

Header `json:"header"`
Data `json:"data"`
Evidence EvidenceList `json:"evidence"`
Evidence EvidenceData `json:"evidence"`
LastCommit *Commit `json:"last_commit"`
}

Expand Down Expand Up @@ -87,8 +87,8 @@ func (b *Block) ValidateBasic() error {
return fmt.Errorf("wrong Header.DataHash. Expected %X, got %X. Len of txs %d", w, g, len(b.Data.Txs))
}

// NOTE: b.Evidence may be nil, but we're just looping.
for i, ev := range b.Evidence {
// NOTE: b.Evidence.Evidence may be nil, but we're just looping.
for i, ev := range b.Evidence.Evidence {
if err := ev.ValidateBasic(); err != nil {
return fmt.Errorf("invalid evidence (#%d): %v", i, err)
}
Expand Down Expand Up @@ -327,7 +327,7 @@ func MakeBlock(height int64, txs []Tx, lastCommit *Commit, evidence []Evidence)
Data: Data{
Txs: txs,
},
Evidence: evidence,
Evidence: EvidenceData{Evidence: evidence},
LastCommit: lastCommit,
}
block.fillHeader()
Expand Down Expand Up @@ -1372,6 +1372,97 @@ func DataFromProto(dp *tmproto.Data) (Data, error) {
return *data, nil
}

//-----------------------------------------------------------------------------

// EvidenceData contains any evidence of malicious wrong-doing by validators
type EvidenceData struct {
Evidence EvidenceList `json:"evidence"`

// Volatile. Used as cache
hash tmbytes.HexBytes
byteSize int64
}

// Hash returns the hash of the data.
func (data *EvidenceData) Hash() tmbytes.HexBytes {
if data.hash == nil {
data.hash = data.Evidence.Hash()
}
return data.hash
}

// ByteSize returns the total byte size of all the evidence
func (data *EvidenceData) ByteSize() int64 {
if data.byteSize == 0 && len(data.Evidence) != 0 {
pb, err := data.ToProto()
if err != nil {
panic(err)
}
data.byteSize = int64(pb.Size())
}
return data.byteSize
}

// StringIndented returns a string representation of the evidence.
func (data *EvidenceData) StringIndented(indent string) string {
if data == nil {
return "nil-Evidence"
}
evStrings := make([]string, tmmath.MinInt(len(data.Evidence), 21))
for i, ev := range data.Evidence {
if i == 20 {
evStrings[i] = fmt.Sprintf("... (%v total)", len(data.Evidence))
break
}
evStrings[i] = fmt.Sprintf("Evidence:%v", ev)
}
return fmt.Sprintf(`EvidenceData{
%s %v
%s}#%v`,
indent, strings.Join(evStrings, "\n"+indent+" "),
indent, data.hash)
}

// ToProto converts EvidenceData to protobuf
func (data *EvidenceData) ToProto() (*tmproto.EvidenceList, error) {
if data == nil {
return nil, errors.New("nil evidence data")
}

evi := new(tmproto.EvidenceList)
eviBzs := make([]tmproto.Evidence, len(data.Evidence))
for i := range data.Evidence {
protoEvi, err := EvidenceToProto(data.Evidence[i])
if err != nil {
return nil, err
}
eviBzs[i] = *protoEvi
}
evi.Evidence = eviBzs

return evi, nil
}

// FromProto sets a protobuf EvidenceData to the given pointer.
func (data *EvidenceData) FromProto(eviData *tmproto.EvidenceList) error {
if eviData == nil {
return errors.New("nil evidenceData")
}

eviBzs := make(EvidenceList, len(eviData.Evidence))
for i := range eviData.Evidence {
evi, err := EvidenceFromProto(&eviData.Evidence[i])
if err != nil {
return err
}
eviBzs[i] = evi
}
data.Evidence = eviBzs
data.byteSize = int64(eviData.Size())

return nil
}

//--------------------------------------------------------------------------------

// BlockID
Expand Down
Loading