google / google/trillian-examples

Witness can't recover from invalid proof supplied to TOFU update

Open
#532 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
176
Forks
68
Avg merge
13h 35m
Merged PRs (30d)
4

Description

I just got myself into a pickle - I accidentally misconfigured a witness for a compact-range based log, forgetting to set `UseCompact: true` in the witness config. The feeder happily sent down the TOFU checkpoint + proof, which the witness stored in the DB, but the next attempt to update failed with:

```
main.go:97] Failed to feed: failed to update checkpoint: bad status response (500 Internal Server Error): "failed to update to new checkpoint: couldn't unmarshal proof: data should have trailing newline on last hash too\n"`
```

Eventually I figured out what I'd done wrong, and I updated the witness config, but the witness was borked for that log and the only way to recover without losing the state for the other logs being witnessed was to use the `sqlite3` tool and manually delete the row corresponding to the borked log.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.