Skip to content

Commit bf71b46

Browse files
committed
[FAB-11955] Enhanced error message for SB validation
This change set logs cc:coll:key and full block height in case of SBEP validation error. Change-Id: Ie7804c49e0ddfbb3dfcbeda86eaddbb6347528df Signed-off-by: Alessandro Sorniotti <ale.linux@sopit.net> Signed-off-by: Matthias Neugschwandtner <eug@zurich.ibm.com>
1 parent 9c4939f commit bf71b46

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

core/common/validation/statebased/vpmanager.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ import (
1414
// Validation Parameters for a key could not be
1515
// supplied because they are being updated
1616
type ValidationParameterUpdatedError struct {
17+
CC string
18+
Coll string
1719
Key string
1820
Height uint64
21+
Txnum uint64
1922
}
2023

2124
func (f *ValidationParameterUpdatedError) Error() string {
22-
return fmt.Sprintf("validation parameters for key %s have been changed in a transaction in block %d", f.Key, f.Height)
25+
return fmt.Sprintf("validation parameters for key [%s] in namespace [%s:%s] have been changed in transaction %d of block %d", f.Key, f.CC, f.Coll, f.Txnum, f.Height)
2326
}
2427

2528
// KeyLevelValidationParameterManager is used by validation plugins in order

core/common/validation/statebased/vpmanagerimpl.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,11 @@ func (c *validationContext) waitForValidationResults(kid *ledgerKeyID, blockNum
219219
for _, dep := range c.dependenciesForTxnum(kid, txnum) {
220220
if valErr := dep.waitForAndRetrieveValidationResult(kid.cc); valErr == nil {
221221
return &ValidationParameterUpdatedError{
222+
CC: kid.cc,
223+
Coll: kid.coll,
222224
Key: kid.key,
223225
Height: blockNum,
226+
Txnum: txnum,
224227
}
225228
}
226229
}

0 commit comments

Comments
 (0)