diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index 41179cf43..72039a61c 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -12,6 +12,7 @@ import ( "sync/atomic" "time" + json "github.com/nspcc-dev/go-ordered-json" "github.com/nspcc-dev/neo-go/pkg/config" "github.com/nspcc-dev/neo-go/pkg/config/limits" "github.com/nspcc-dev/neo-go/pkg/core/block" @@ -535,8 +536,10 @@ func (bc *Blockchain) init() error { return fmt.Errorf("failed to check native %s state against autogenerated one: %w", md.Name, err) } if !bytes.Equal(storedCSBytes, autogenCSBytes) { - return fmt.Errorf("native %s: version mismatch (stored contract state differs from autogenerated one), "+ - "try to resynchronize the node from the genesis", md.Name) + storedJ, _ := json.Marshal(storedCS) + autogenJ, _ := json.Marshal(autogenCS) + return fmt.Errorf("native %s: version mismatch for the latest hardfork %s (stored contract state differs from autogenerated one), "+ + "try to resynchronize the node from the genesis: %s vs %s", md.Name, current, string(storedJ), string(autogenJ)) } } diff --git a/pkg/core/blockchain_neotest_test.go b/pkg/core/blockchain_neotest_test.go index 32d5ec93f..de7f157f8 100644 --- a/pkg/core/blockchain_neotest_test.go +++ b/pkg/core/blockchain_neotest_test.go @@ -269,7 +269,7 @@ func TestBlockchain_StartFromExistingDB(t *testing.T) { _, _, _, err = chain.NewMultiWithCustomConfigAndStoreNoCheck(t, customConfig, cache) require.Error(t, err) - require.True(t, strings.Contains(err.Error(), fmt.Sprintf("native %s: version mismatch (stored contract state differs from autogenerated one)", nativenames.CryptoLib)), err) + require.True(t, strings.Contains(err.Error(), fmt.Sprintf("native %s: version mismatch for the latest hardfork Cockatrice (stored contract state differs from autogenerated one)", nativenames.CryptoLib)), err) }) t.Run("good", func(t *testing.T) {