Skip to content

refactor: Remove go-fraud dependency and related dead code #4930

@rootulp

Description

@rootulp

Summary

Remove the github.com/celestiaorg/go-fraud dependency from celestia-node as fraud proofs are no longer working post-shwap and there are no plans to add them back. This will reduce maintenance burden and allow archiving the go-fraud repository.

Background

Discussion from Slack: Fraud proofs are not functional post-shwap, and there are no plans to reintroduce them. The go-fraud repository has accumulated recent PRs that require maintenance but provide no value since the functionality is unused.

Scope of Removal

Dependencies

  • Remove github.com/celestiaorg/go-fraud v0.2.3 from go.mod (line 14)

Packages to Remove

  • nodebuilder/fraud/ - entire package including:
    • module.go - fx module construction
    • fraud.go - interface definitions
    • constructors.go - service constructors
    • lifecycle.go - ServiceBreaker (granular service termination on fraud)
    • unmarshaler.go - proof unmarshaling
    • mocks/api.go - generated mocks

Files Requiring Modification

  • go.mod / go.sum - remove dependency
  • nodebuilder/module.go - remove fraud module registration
  • nodebuilder/node.go - remove fraud-related code
  • nodebuilder/settings.go - remove fraud imports/usage
  • nodebuilder/default_services.go - remove fraud service
  • nodebuilder/das/constructors.go - remove fraud/ServiceBreaker wrapping
  • nodebuilder/p2p/pubsub.go - remove fraud pubsub setup
  • nodebuilder/rpc/constructors.go - remove fraud RPC handlers
  • das/daser.go - remove fraud proof handling
  • share/eds/byzantine/bad_encoding.go - remove BEFP (BadEncodingFraudProof) implementation
  • api/docgen/examples.go - remove fraud examples

Tests to Remove

  • nodebuilder/tests/fraud_test.go - fraud integration tests
  • das/daser_test.go - fraud-related test code

Notes

  • The ServiceBreaker (in nodebuilder/fraud/lifecycle.go) was responsible for stopping services when fraud proofs were detected. Since fraud proofs won't be part of the protocol going forward, this can be removed entirely rather than replaced.
  • This is a straight-forward removal of dead code, not a replacement with alternative functionality.

Related

Once this is complete, the [go-fraud repository](https://github.com/celestiaorg/go-fraud) can be archived.

Slack thread: https://celestia-team.slack.com/archives/C05CYC8EHBM/p1775836720278889?thread_ts=1775829066.847419&cid=C05CYC8EHBM


Would you like me to help with anything else, such as actually implementing this removal?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions