ethereum / go-verkle

A go implementation of Verkle trees
The Unlicense
215 stars 67 forks source link

make BatchSerialize not return an error #435

Open jwasinger opened 5 months ago

jwasinger commented 5 months ago

Afaict, it should be safe to assume that a tree being serialized is not malformed. Otherwise, it is catastrophic (programming error) and we might as well let it panic.

jwasinger commented 5 months ago

In this case, it doesn't increase the avenues for debugging. A panic will point directly to the place where the error is caused. Returning it does the same.

Seems weird to percolate an internal logic error (that a user of this lib has no reasonable way to recover from) through a public interface.

jwasinger commented 5 months ago

Oh, I just remove the error check and don't panic at all. Happy to add that if it would make debugging easier.