Cosmos跟踪验证节点的签名信息

下面是代码里的关键结构体

cosmos/cosmos-sdk/x/slashing/signing_info.go

 62 type ValidatorSigningInfo struct {
 63     // height at which validator was first a candidate OR was unrevoked
 64     StartHeight         int64     `json:"start_height"`    
 65     // index offset into signed block bit array     
 66     IndexOffset         int64     `json:"index_offset"` 
 67     // timestamp validator cannot be unrevoked until        
 68     JailedUntil         time.Time `json:"jailed_until"`     
 69     // signed blocks counter (to avoid scanning the array every time) 
 70     SignedBlocksCounter int64     `json:"signed_blocks_counter"` 
 71 }

我们在validator上运行下面这个命令

gaiacli stake signing-info "$(gaiad tendermint show_validator)" -o json|jq

下面是输出内容


image.png

下面是cosmos里的具体惩罚逻辑

源码:cosmos/cosmos-sdk/x/slashing/keeper.go


image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。