celestiaorg / go-header

Go library with all the services needed to request, sync and store blockchain headers.
Apache License 2.0
17 stars 16 forks source link

Validation Rejection does not propagate the exact error #146

Closed gupadhyaya closed 5 months ago

gupadhyaya commented 5 months ago

Rollkit sequencer broadcast header/block to p2p network and in the event of validation rejection, the exact reason (error) is not propagated back to the client. Refer to https://github.com/rollkit/rollkit/issues/969#issuecomment-1902594754 for details, where only validation failed is seen without known header: '1' <= current '1' which was the reason for validation failure.

Wondertan commented 5 months ago

The error is coming from go-libp2p-pubsub, and we can't fix this issue in go-header without contributing to pubsub and changing the registered validator func signature. Right now, it only returns ValidationResult{Accept,Ignore,Reject} without an error or additional info, and during local broadcasting failure the ValidationResult is swapped with error string you observe

gupadhyaya commented 5 months ago

thanks for the information.