@@ -215,6 +215,14 @@ impl NakamotoBlockProposal {
215
215
216
216
let mainnet = self . chain_id == CHAIN_ID_MAINNET ;
217
217
if self . chain_id != chainstate. chain_id || mainnet != chainstate. mainnet {
218
+ warn ! (
219
+ "Rejected block proposal" ;
220
+ "reason" => "Wrong network/chain_id" ,
221
+ "expected_chain_id" => chainstate. chain_id,
222
+ "expected_mainnet" => chainstate. mainnet,
223
+ "received_chain_id" => self . chain_id,
224
+ "received_mainnet" => mainnet,
225
+ ) ;
218
226
return Err ( BlockValidateRejectReason {
219
227
reason_code : ValidateRejectCode :: InvalidBlock ,
220
228
reason : "Wrong network/chain_id" . into ( ) ,
@@ -227,6 +235,10 @@ impl NakamotoBlockProposal {
227
235
let expected_burn_opt =
228
236
NakamotoChainState :: get_expected_burns ( & mut db_handle, chainstate. db ( ) , & self . block ) ?;
229
237
if expected_burn_opt. is_none ( ) {
238
+ warn ! (
239
+ "Rejected block proposal" ;
240
+ "reason" => "Failed to find parent expected burns" ,
241
+ ) ;
230
242
return Err ( BlockValidateRejectReason {
231
243
reason_code : ValidateRejectCode :: UnknownParent ,
232
244
reason : "Failed to find parent expected burns" . into ( ) ,
@@ -259,13 +271,25 @@ impl NakamotoBlockProposal {
259
271
& parent_stacks_header. anchored_header
260
272
{
261
273
if self . block . header . timestamp <= parent_nakamoto_header. timestamp {
274
+ warn ! (
275
+ "Rejected block proposal" ;
276
+ "reason" => "Block timestamp is not greater than parent block" ,
277
+ "block_timestamp" => self . block. header. timestamp,
278
+ "parent_block_timestamp" => parent_nakamoto_header. timestamp,
279
+ ) ;
262
280
return Err ( BlockValidateRejectReason {
263
281
reason_code : ValidateRejectCode :: InvalidBlock ,
264
282
reason : "Block timestamp is not greater than parent block" . into ( ) ,
265
283
} ) ;
266
284
}
267
285
}
268
286
if self . block . header . timestamp > get_epoch_time_secs ( ) + 15 {
287
+ warn ! (
288
+ "Rejected block proposal" ;
289
+ "reason" => "Block timestamp is too far into the future" ,
290
+ "block_timestamp" => self . block. header. timestamp,
291
+ "current_time" => get_epoch_time_secs( ) ,
292
+ ) ;
269
293
return Err ( BlockValidateRejectReason {
270
294
reason_code : ValidateRejectCode :: InvalidBlock ,
271
295
reason : "Block timestamp is too far into the future" . into ( ) ,
0 commit comments