From 3ae4b793e68f9062df9b90c22f5004130d2fe816 Mon Sep 17 00:00:00 2001 From: dv8silencer <15720668+dv8silencer@users.noreply.github.com> Date: Tue, 24 Nov 2020 23:15:30 -0600 Subject: [PATCH] Improve error log for when database network conflicts with runtime network (#7945) Co-authored-by: Raul Jordan Co-authored-by: Preston Van Loon --- beacon-chain/node/node.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/beacon-chain/node/node.go b/beacon-chain/node/node.go index ddc3c9561..9b9487db8 100644 --- a/beacon-chain/node/node.go +++ b/beacon-chain/node/node.go @@ -507,7 +507,10 @@ func (b *BeaconNode) registerPOWChainService() error { } } if len(knownContract) > 0 && !bytes.Equal(cfg.DepositContract.Bytes(), knownContract) { - return fmt.Errorf("database contract is %#x but tried to run with %#x", knownContract, cfg.DepositContract.Bytes()) + return fmt.Errorf("database contract is %#x but tried to run with %#x. This likely means "+ + "you are trying to run on a different network than what the database contains. You can run once with "+ + "'--clear-db' to wipe the old database or use an alternative data directory with '--datadir'", + knownContract, cfg.DepositContract.Bytes()) } log.Infof("Deposit contract: %#x", cfg.DepositContract.Bytes())