helium / blockchain-core

Apache License 2.0
214 stars 85 forks source link

handle case where block is not on chain as yet #1455

Closed andymck closed 1 year ago

andymck commented 1 year ago

Addresses the error below encountered by chain followers after the 1.13.5 deployment, possibly a side effect from loading latest snap and whilst chain is itself still syncing

2022-08-09 07:45:51 =CRASH REPORT==== crasher: initial call: blockchain_follower:init/1 pid: <0.1533.0> registered_name: [] exception error: {{badmatch,{error,not_found}},[{blockchain_follower,'-handle_info/2-fun-0-',5,[{file,"blockchain_follower.erl"},{line,105}]},{lists,foldl,3,[{file,"lists.erl"},{line,1267}]},{blockchain_follower,handle_info,2,[{file,"blockchain_follower.erl"},{line,118}]},{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,695}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,771}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]} ancestors: [bn_sup,<0.1438.0>] message_queue_len: 0 messages: [] links: [<0.1439.0>] dictionary: [] trap_exit: false status: running heap_size: 196650 stack_size: 28 reductions: 112469 neighbours: 2022-08-09 07:45:51 =SUPERVISOR REPORT==== Supervisor: {local,bn_sup} Context: shutdown_error Reason: {{badmatch,{error,not_found}},[{blockchain_follower,'-handle_info/2-fun-0-',5,[{file,"blockchain_follower.erl"},{line,105}]},{lists,foldl,3,[{file,"lists.erl"},{line,1267}]},{blockchain_follower,handle_info,2,[{file,"blockchain_follower.erl"},{line,118}]},{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,695}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,771}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,226}]}]} Offender: [{pid,<0.1533.0>},{id,pending_txn_follower},{mfargs,{blockchain_follower,start_link,[[{follower_module,{bn_pending_txns,[{base_dir,"/var/data"}]}}]]}},{restart_type,permanent},{significant,false},{shutdown,5000},{child_type,worker}]

andymck commented 1 year ago

closing as the block gap is never going to get filled. usually happens when a snap is loaded onto a follower which is past the follower height