Conflux-Chain / conflux-rust

The official Rust implementation of Conflux protocol. https://doc.confluxnetwork.org
https://doc.confluxnetwork.org
GNU General Public License v3.0
646 stars 197 forks source link

Error while handling message: genesis hash mismatches #2553

Open anthonypan08 opened 2 years ago

anthonypan08 commented 2 years ago

I am trying to follow the instructions from here. However I keep getting the error message below

essage, peer=0x5da9…23de, msgid=35, error=Error(InvalidStatus("genesis hash mismatches"), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })
2022-07-16T21:08:21.873298607-04:00 WARN  Socket IO Worker #1  cfxcore::syn - Error while handling message, peer=0xc22a…7efb, msgid=35, error=Error(InvalidStatus("genesis hash mismatches"), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })
2022-07-16T21:08:22.184313374-04:00 WARN  Socket IO Worker #0  cfxcore::syn - Error while handling message, peer=0x838e…7cd8, msgid=35, error=Error(InvalidStatus("genesis hash mismatches"), State { next_error: None, backtrace: InternalBacktrace { backtrace: None } })

I am on v2.0.0 and cargo build --release works . ./dev-support/test.sh had some errors (which may be an issue?) but cargo test --release --all seems to work

Here is my hydra.toml diff with origin/master

jonathan@jonathan-HP-Pavilion-Laptop-15t-eg100:~/conflux-rust/run$ git diff origin/master hydra.toml
diff --git a/run/hydra.toml b/run/hydra.toml
index e55a662c..91abf5e7 100644
--- a/run/hydra.toml
+++ b/run/hydra.toml
@@ -33,7 +33,7 @@ bootnodes="cfxnode://dc79bc70833e797ba41eff5bda67c0484abca4918ef38289b5f96acd3da
 #       in fixed period, see ``dev_block_interval_ms'')
 #     * Skip catch-up mode even there is no peer
 #
-# mode = ""
+mode = "dev"

 # If you want to setup a single node running Conflux for development. You should
 # COMMENT the bootnodes setting and you should use the following parameters:
@@ -62,8 +62,9 @@ bootnodes="cfxnode://dc79bc70833e797ba41eff5bda67c0484abca4918ef38289b5f96acd3da
 # The default value is "stratum" if `mining_author` is set.
 # If the value is set and not "disable", `mining_author` must be set.
 #
-# mining_type = "stratum"
-
+start_mining = "true"
+mining_type = "stratum"
+mining_author = "cfx:aar87w8511r2mgdfd3f00j819160v29zw6guvtvrvp"
 # Listen address for stratum
 #
 # stratum_listen_address = "127.0.0.1"
@@ -106,7 +107,7 @@ log_conf="log.yaml"
 # If not set, the process will try to find out the public IP with best effort, and use `tcp_port` as public port.
 # However, it's HIGHLY RECOMMENDED to set the value manually, especially for machines with IP translated by NAT.
 #
-# public_address="1.1.1.1"
+public_address="74.109.250.72:32323"

 # `tcp_port` is the TCP port that the process listens for P2P messages. The default is 32323.
 #
@@ -144,10 +145,10 @@ log_conf="log.yaml"
 # Note that to serve transaction-related RPCs, `persist_tx_index` should also be set to `true` or
 # the node will only be able to handle very recent transactions.
 #
-# jsonrpc_ws_port=12535
-# jsonrpc_tcp_port=12536
-# jsonrpc_http_port=12537
-# jsonrpc_local_tcp_port=12538
+jsonrpc_ws_port=12535
+jsonrpc_tcp_port=12536
+jsonrpc_http_port=12537
+jsonrpc_local_tcp_port=12538
 jsonrpc_local_http_port=12539
 # jsonrpc_local_ws_port=12540
 # jsonrpc_http_eth_port=8545
@@ -255,10 +256,6 @@ jsonrpc_local_http_port=12539
 #
 # min_peers_tx_propagation = 8

-# Minimum number of normal-phase peers to estimate the current global latest epoch for phase change.
-#
-# min_phase_change_normal_peer_count = 3
-
 # The time to maintain received transactions to avoid duplicated requests.
 #
 # received_tx_index_maintain_timeout_ms = 300_000
@@ -387,7 +384,7 @@ jsonrpc_local_http_port=12539

 # Minimum allowed transaction gas price in the transaction pool.
 #
-# tx_pool_min_tx_gas_price = 1_000_000_000
+# tx_pool_min_tx_gas_price = 1

 # ------------------ Storage Parameters ----------------------

@@ -519,10 +516,10 @@ jsonrpc_local_http_port=12539
 #
 # future_block_buffer_capacity = 32768

-# Maximum number of log entries returned from cfx_getLogs and eth_getLogs.
-# If not set, cfx_getLogs and eth_getLogs will not limit the number of logs returned.
+# Maximum number of log entries returned from cfx_getLogs.
+# If not set, cfx_getLogs will not limit the number of logs returned.
 #
-get_logs_filter_max_limit = 5000
+# get_logs_filter_max_limit = 10

 # Epoch batch size used in log filtering.
 # Larger batch sizes may improve performance but might also prevent consensus from making progress under high RPC load.
@@ -535,12 +532,6 @@ get_logs_filter_max_limit = 5000
 #
 # get_logs_filter_max_epoch_range = 10000

-# The maximal allowed number of blocks between `from_block` and `to_block` in the filter to call `cfx_getLogs`.
-# If not set, there is no limit on the gap.
-# By default it is not set.
-#
-# get_logs_filter_max_block_number_range = 10000
-
 # Maximum number of transactions allowed for peers to send to a catch-up node.
 #
 # max_trans_count_received_in_catch_up = 60_000
@@ -554,8 +545,4 @@ chain_id = 1029
 # The EVM chain ID of Conflux Network (EVM space)
 # 1030 for Mainnet (Hydra)
 #
-evm_chain_id = 1030
-hydra_transition_number = 92060600
-hydra_transition_height = 36935000
-cip43_init_end_number = 92751800
-pos_reference_enable_height = 37400000
\ No newline at end of file
+evm_chain_id = 1030
\ No newline at end of file

Any ideas?

peilun-conflux commented 2 years ago

If the warning is not very frequent and your node is making progress, your node should be okay, and this is more likely an issue of other peers. A node with an unmatch genesis (maybe using a testnet binary) is trying to connect to your node.

anthonypan08 commented 2 years ago

It seems to be quite frequent and I don't think my node is making any progress. That is the last thing I see before it stalling out

peilun-conflux commented 2 years ago

Are you using the exact version v2.0.0? The hardcoded hardfork height in that version has been delayed since v2.0.0-fix and v2.0.0 should not be used. It's more suggested to use the latest version v2.0.2 directly, but you can also try to add the hardfork parameters to your config and restart

hydra_transition_number = 92060600
hydra_transition_height = 36935000
cip43_init_end_number = 92751800
pos_reference_enable_height = 37400000

If restarting based on the current data does not work, you may need to resync the data, and this tool can help to start with a recent state (https://github.com/conflux-fans/archive-tool).

anthonypan08 commented 2 years ago
2022-07-17T13:39:50.422085991-04:00 INFO  IO Worker #0         cfxcore::syn - Catch-up mode: true, latest epoch: 520000 missing_bodies: 0
2022-07-17T13:39:50.422176835-04:00 INFO  IO Worker #1         cfxcore::sta - Statistics: StatisticsInner { sync_graph: SyncGraphStatistics { inserted_block_count: 1, inserted_header_count: 299323 }, consensus_graph: ConsensusGraphStatistics { inserted_block_count: 0, activated_block_count: 0, processed_block_count: 0 } }
2022-07-17T13:39:51.422952005-04:00 INFO  IO Worker #3         cfxcore::syn - Catch-up mode: true, latest epoch: 520000 missing_bodies: 0

It is not stalling out now. I am seeing logs like this. Does this mean the full node is working?

The problem is I left it running for 10 minutes but I don't think anything is being mined (i.e. my Fluent wallet still says it is 0)

Here is my new hydra.toml

jonathan@jonathan-HP-Pavilion-Laptop-15t-eg100:~/conflux-rust/run$ git diff
diff --git a/run/hydra.toml b/run/hydra.toml
index 6fcab63b..009cf651 100644
--- a/run/hydra.toml
+++ b/run/hydra.toml
@@ -54,7 +54,8 @@ bootnodes="cfxnode://dc79bc70833e797ba41eff5bda67c0484abca4918ef38289b5f96acd3da
 # The value is a 40-digit hex string or a valid CIP-37 base32 address.
 # By default, the value is not set.
 #
-# mining_author="cfx:aarc9abycue0hhzgyrr53m6cxedgccrmmyybjgh4xg"
+start_mining = "true"
+mining_author="cfx:aar87w8511r2mgdfd3f00j819160v29zw6guvtvrvp"

 # `mining_type` controls whether the mining process goes through the
 # stratum protocol, uses CPU-mining, or disable mining.
@@ -106,7 +107,7 @@ log_conf="log.yaml"
 # If not set, the process will try to find out the public IP with best effort, and use `tcp_port` as public port.
 # However, it's HIGHLY RECOMMENDED to set the value manually, especially for machines with IP translated by NAT.
 #
-# public_address="1.1.1.1"
+public_address="74.109.250.72:32323"

 # `tcp_port` is the TCP port that the process listens for P2P messages. The default is 32323.
 #
anthonypan08 commented 2 years ago

Any ideas/updates?

peilun-conflux commented 2 years ago

No mining is possible until you node syncs to the latest height.

在 2022年7月24日,03:10,anthonypan08 @.***> 写道:



Any ideas/updates?

— Reply to this email directly, view it on GitHubhttps://github.com/Conflux-Chain/conflux-rust/issues/2553#issuecomment-1193174521, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALVD2UGEWCZFDRXYWLAAXFDVVQ7R5ANCNFSM53ZABZPQ. You are receiving this because you commented.Message ID: @.***>