Skip to content

Commit

Permalink
fmt OnBlock logs (#10478)
Browse files Browse the repository at this point in the history
now
```
[DBUG] [05-26|01:38:26.076] OnBlock: block is not validated yet      block="[93 41 180 217 209 177 53 59 176 68 43 201 140 81 177 253 89 239 153 151 136 185 40 53 232 173 149 145 162 169 230 147]"
[DBUG] [05-26|01:38:26.080] OnBlock: block is not validated yet      block="[236 29 192 108 102 212 138 182 146 59 118 249 33 147 188 244 54 179 128 220 57 174 159 131 202 221 69 134 25 208 249 71]"
[DBUG] [05-26|01:38:26.085] OnBlock: block is not validated yet      block="[44 14 140 53 221 114 38 5 235 12 28 46 227 229 87 100 109 5 137 84 164 87 238 167 121 20 82 187 137 105 34 202]"
[DBUG] [05-26|01:38:26.090] OnBlock: block is not validated yet      block="[78 140 102 115 95 80 185 109 86 148 45 140 86 237 206 67 139 109 156 191 29 217 56 61 223 192 86 96 30 102 70 230]"
[DBUG] [05-26|01:38:26.096] OnBlock: block is not validated yet      block="[202 232 94 91 160 74 62 126 77 247 215 0 217 219 215 202 235 209 156 189 163 139 239 191 52 96 213 139 16 224 6 82]"
[DBUG] [05-26|01:38:26.103] OnBlock: block is not validated yet      block="[179 32 193 103 229 54 110 8 29 181 196 126 133 89 18 72 55 78 198 189 211 151 96 92 150 92 52 177 100 53 86 219]"
[DBUG] [05-26|01:38:26.108] OnBlock: block is not validated yet      block="[76 38 81 255 41 74 253 161 61 78 137 79 77 53 6 90 139 113 90 177 220 179 189 107 76 49 190 97 6 69 31 54]"
[DBUG] [05-26|01:38:26.112] OnBlock: block is not validated yet      block="[158 196 0 232 68 154 234 201 13 103 40 217 213 46 241 103 158 247 88 98 102 25 151 153 57 165 74 140 140 203 128 138]"
[DBUG] [05-26|01:38:26.116] OnBlock: block is not validated yet      block="[249 106 250 61 58 123 78 74 209 68 155 235 93 166 194 130 45 149 204 12 191 129 110 212 198 157 186 217 5 50 43 59]"
```
  • Loading branch information
AskAlexSharov authored May 27, 2024
1 parent 51bbeef commit 7f4ea16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cl/phase1/forkchoice/on_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (f *ForkChoiceStore) OnBlock(ctx context.Context, block *cltypes.SignedBeac
if err == ErrEIP4844DataNotAvailable {
return err
}
return fmt.Errorf("OnBlock: data is not available for block %x: %v", blockRoot, err)
return fmt.Errorf("OnBlock: data is not available for block %x: %v", libcommon.Hash(blockRoot), err)
}
}

Expand All @@ -100,21 +100,21 @@ func (f *ForkChoiceStore) OnBlock(ctx context.Context, block *cltypes.SignedBeac
payloadStatus, err := f.engine.NewPayload(ctx, block.Block.Body.ExecutionPayload, &block.Block.ParentRoot, versionedHashes)
switch payloadStatus {
case execution_client.PayloadStatusNotValidated:
log.Debug("OnBlock: block is not validated yet", "block", blockRoot)
log.Debug("OnBlock: block is not validated yet", "block", libcommon.Hash(blockRoot))
// optimistic block candidate
if err := f.optimisticStore.AddOptimisticCandidate(block.Block); err != nil {
return fmt.Errorf("failed to add block to optimistic store: %v", err)
}
case execution_client.PayloadStatusInvalidated:
log.Debug("OnBlock: block is invalid", "block", blockRoot)
log.Debug("OnBlock: block is invalid", "block", libcommon.Hash(blockRoot))
f.forkGraph.MarkHeaderAsInvalid(blockRoot)
// remove from optimistic candidate
if err := f.optimisticStore.InvalidateBlock(block.Block); err != nil {
return fmt.Errorf("failed to remove block from optimistic store: %v", err)
}
return fmt.Errorf("block is invalid")
case execution_client.PayloadStatusValidated:
log.Debug("OnBlock: block is validated", "block", blockRoot)
log.Debug("OnBlock: block is validated", "block", libcommon.Hash(blockRoot))
// remove from optimistic candidate
if err := f.optimisticStore.ValidateBlock(block.Block); err != nil {
return fmt.Errorf("failed to validate block in optimistic store: %v", err)
Expand Down

0 comments on commit 7f4ea16

Please sign in to comment.