From aef13d817485e2926bebf705b010a714ec911ee7 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 12 Mar 2025 18:39:29 +0100 Subject: [PATCH] rpc: change constant value for "earliest" block With history pruning, we want to redefine what the "earliest" block tag means. We need to assign a special negative integer value to this constant, otherwise we cannot tell it apart from block zero, the genesis block. --- rpc/types.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc/types.go b/rpc/types.go index 2e53174b87..85f15344e8 100644 --- a/rpc/types.go +++ b/rpc/types.go @@ -63,11 +63,11 @@ type jsonWriter interface { type BlockNumber int64 const ( + EarliestBlockNumber = BlockNumber(-5) SafeBlockNumber = BlockNumber(-4) FinalizedBlockNumber = BlockNumber(-3) LatestBlockNumber = BlockNumber(-2) PendingBlockNumber = BlockNumber(-1) - EarliestBlockNumber = BlockNumber(0) ) // UnmarshalJSON parses the given JSON fragment into a BlockNumber. It supports: