Skip to content

Commit 4fde4a3

Browse files
author
Aurélien Richez
committed
Adds bestBlock hash in app state
1 parent 1377cb6 commit 4fde4a3

27 files changed

+150
-90
lines changed

bytes/src/main/scala/io/iohk/ethereum/utils/Hex.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.iohk.ethereum.utils
22

3+
import akka.util.ByteString
4+
35
object Hex {
46
def toHexString(bytes: Array[Byte]): String =
57
bytes.map("%02x".format(_)).mkString

src/it/scala/io/iohk/ethereum/ledger/BlockImporterItSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class BlockImporterItSpec
107107
blockchainWriter.save(oldBlock3, Nil, oldWeight3, saveAsBestBlock = true)
108108
blockchainWriter.save(oldBlock4, Nil, oldWeight4, saveAsBestBlock = true)
109109
// simulation of node restart
110-
blockchain.saveBestKnownBlocks(blockchainReader.getBestBlockNumber() - 1)
110+
blockchain.saveBestKnownBlocks(oldBlock3.header.hash, oldBlock3.number)
111111
blockchainWriter.save(newBlock4ParentOldBlock3, Nil, newBlock4WeightParentOldBlock3, saveAsBestBlock = true)
112112

113113
//not reorganising anymore until oldBlock4(not part of the chain anymore), no block/ommer validation when not part of the chain, resolveBranch is returning UnknownBranch

src/it/scala/io/iohk/ethereum/sync/util/CommonFakePeer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ abstract class CommonFakePeer(peerName: String, fakePeerCustomConfig: FakePeerCu
139139
)
140140

141141
val blockchainMetadata = new BlockchainMetadata(
142-
storagesInstance.storages.appStateStorage.getBestBlockNumber(),
142+
storagesInstance.storages.appStateStorage.getBestBlockData(),
143143
storagesInstance.storages.appStateStorage.getLatestCheckpointBlockNumber()
144144
)
145145
val blockchainReader: BlockchainReader = BlockchainReader(storagesInstance.storages, blockchainMetadata)

src/it/scala/io/iohk/ethereum/txExecTest/util/DumpChainApp.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ class BlockchainMock(genesisHash: ByteString) extends Blockchain {
200200

201201
def saveBlockNumber(number: BigInt, hash: NodeHash): Unit = ???
202202

203-
def saveBestKnownBlocks(bestBlockNumber: BigInt, latestCheckpointNumber: Option[BigInt] = None): Unit = ???
203+
override def saveBestKnownBlocks(
204+
bestBlockHash: NodeHash,
205+
bestBlockNumber: BigInt,
206+
latestCheckpointNumber: Option[BigInt]
207+
): Unit = ???
204208

205209
def getBestBlock(): Option[Block] = ???
206210

@@ -209,4 +213,5 @@ class BlockchainMock(genesisHash: ByteString) extends Blockchain {
209213
override def getBackingMptStorage(blockNumber: BigInt): MptStorage = ???
210214

211215
override def getReadOnlyMptStorage(): MptStorage = ???
216+
212217
}

src/main/scala/io/iohk/ethereum/blockchain/sync/fast/FastSync.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ class FastSync(
11371137
val bestReceivedBlock = fullBlocks.maxBy(_.number)
11381138
val lastStoredBestBlockNumber = appStateStorage.getBestBlockNumber()
11391139
if (lastStoredBestBlockNumber < bestReceivedBlock.number) {
1140-
blockchain.saveBestKnownBlocks(bestReceivedBlock.number)
1140+
blockchain.saveBestKnownBlocks(bestReceivedBlock.hash, bestReceivedBlock.number)
11411141
appStateStorage.putBestBlockNumber(bestReceivedBlock.number).commit()
11421142
}
11431143
syncState = syncState.copy(lastFullBlockNumber = bestReceivedBlock.number.max(lastStoredBestBlockNumber))

src/main/scala/io/iohk/ethereum/db/storage/AppStateStorage.scala

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
package io.iohk.ethereum.db.storage
22

3-
import java.math.BigInteger
3+
import akka.util.ByteString
4+
import boopickle.Default.Unpickle
5+
import boopickle.Pickler
6+
import boopickle.DefaultBasic._
47

8+
import java.math.BigInteger
59
import scala.collection.immutable.ArraySeq
6-
710
import io.iohk.ethereum.db.dataSource.DataSource
811
import io.iohk.ethereum.db.dataSource.DataSourceBatchUpdate
912
import io.iohk.ethereum.db.storage.AppStateStorage._
13+
import io.iohk.ethereum.domain.appstate.BestBlockInfo
14+
import io.iohk.ethereum.utils.ByteUtils.{byteSequenceToBuffer, compactPickledBytes}
15+
import io.iohk.ethereum.utils.Hex
16+
import io.iohk.ethereum.utils.Picklers._
1017

1118
/** This class is used to store app state variables
1219
* Key: see AppStateStorage.Keys
@@ -27,6 +34,16 @@ class AppStateStorage(val dataSource: DataSource) extends TransactionalKeyValueS
2734
def getBestBlockNumber(): BigInt =
2835
getBigInt(Keys.BestBlockNumber)
2936

37+
def getBestBlockData(): BestBlockInfo =
38+
BestBlockInfo( // FIXME default value for hash ?
39+
get(Keys.BestBlockHash).map(v => ByteString(Hex.decode(v))).getOrElse(ByteString.empty),
40+
getBigInt(Keys.BestBlockNumber)
41+
)
42+
43+
def putBestBlockData(b: BestBlockInfo): DataSourceBatchUpdate =
44+
put(Keys.BestBlockNumber, b.number.toString)
45+
.and(put(Keys.BestBlockHash, Hex.toHexString(b.hash.toArray)))
46+
3047
def putBestBlockNumber(bestBlockNumber: BigInt): DataSourceBatchUpdate =
3148
put(Keys.BestBlockNumber, bestBlockNumber.toString)
3249

@@ -72,9 +89,17 @@ object AppStateStorage {
7289

7390
object Keys {
7491
val BestBlockNumber = "BestBlockNumber"
92+
val BestBlockHash = "BestBlockHash"
7593
val FastSyncDone = "FastSyncDone"
7694
val EstimatedHighestBlock = "EstimatedHighestBlock"
7795
val SyncStartingBlock = "SyncStartingBlock"
7896
val LatestCheckpointBlockNumber = "LatestCheckpointBlockNumber"
7997
}
98+
99+
implicit private val bestBlockDataPickler: Pickler[BestBlockInfo] = generatePickler[BestBlockInfo]
100+
private val bestBlockDataSerializer = (bestBlockData: BestBlockInfo) =>
101+
compactPickledBytes(Pickle.intoBytes(bestBlockData))
102+
private val bestBlockDataDeserializer =
103+
(byteSequenceToBuffer _).andThen(Unpickle[BestBlockInfo].fromBytes)
104+
80105
}

src/main/scala/io/iohk/ethereum/domain/Blockchain.scala

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package io.iohk.ethereum.domain
22

33
import akka.util.ByteString
4-
54
import scala.annotation.tailrec
6-
75
import io.iohk.ethereum.db.dataSource.DataSourceBatchUpdate
86
import io.iohk.ethereum.db.storage._
97
import io.iohk.ethereum.domain
8+
import io.iohk.ethereum.domain.appstate.BestBlockInfo
109
import io.iohk.ethereum.jsonrpc.ProofService.StorageProof
1110
import io.iohk.ethereum.ledger.InMemoryWorldStateProxy
1211
import io.iohk.ethereum.ledger.InMemoryWorldStateProxyStorage
@@ -64,7 +63,11 @@ trait Blockchain {
6463

6564
def removeBlock(hash: ByteString, withState: Boolean): Unit
6665

67-
def saveBestKnownBlocks(bestBlockNumber: BigInt, latestCheckpointNumber: Option[BigInt] = None): Unit
66+
def saveBestKnownBlocks(
67+
bestBlockHash: ByteString,
68+
bestBlockNumber: BigInt,
69+
latestCheckpointNumber: Option[BigInt] = None
70+
): Unit
6871

6972
}
7073

@@ -144,20 +147,29 @@ class BlockchainImpl(
144147
.commit()
145148
}
146149

147-
override def saveBestKnownBlocks(bestBlockNumber: BigInt, latestCheckpointNumber: Option[BigInt] = None): Unit =
150+
override def saveBestKnownBlocks(
151+
bestBlockHash: ByteString,
152+
bestBlockNumber: BigInt,
153+
latestCheckpointNumber: Option[BigInt] = None
154+
): Unit =
148155
latestCheckpointNumber match {
149156
case Some(number) =>
150-
saveBestKnownBlockAndLatestCheckpointNumber(bestBlockNumber, number)
157+
saveBestKnownBlockAndLatestCheckpointNumber(bestBlockHash, bestBlockNumber, number)
151158
case None =>
152-
saveBestKnownBlock(bestBlockNumber)
159+
saveBestKnownBlock(bestBlockHash, bestBlockNumber)
153160
}
154161

155-
private def saveBestKnownBlock(bestBlockNumber: BigInt): Unit =
156-
blockchainMetadata.bestKnownBlockAndLatestCheckpoint.updateAndGet(_.copy(bestBlockNumber = bestBlockNumber))
157-
158-
private def saveBestKnownBlockAndLatestCheckpointNumber(number: BigInt, latestCheckpointNumber: BigInt): Unit =
162+
private def saveBestKnownBlock(bestBlockHash: ByteString, bestBlockNumber: BigInt): Unit =
163+
blockchainMetadata.bestKnownBlockAndLatestCheckpoint.updateAndGet(v =>
164+
v.copy(bestBlockInfo = BestBlockInfo(bestBlockHash, bestBlockNumber))
165+
)
166+
private def saveBestKnownBlockAndLatestCheckpointNumber(
167+
bestBlockHash: ByteString,
168+
number: BigInt,
169+
latestCheckpointNumber: BigInt
170+
): Unit =
159171
blockchainMetadata.bestKnownBlockAndLatestCheckpoint.set(
160-
BestBlockLatestCheckpointNumbers(number, latestCheckpointNumber)
172+
BestBlockLatestCheckpointNumbers(BestBlockInfo(bestBlockHash, number), latestCheckpointNumber)
161173
)
162174

163175
private def removeBlockNumberMapping(number: BigInt): DataSourceBatchUpdate =
@@ -188,7 +200,8 @@ class BlockchainImpl(
188200
removeBlockNumberMapping(block.number)
189201
else blockNumberMappingStorage.emptyBatchUpdate
190202

191-
val newBestBlockNumber: BigInt = (bestBlockNumber - 1).max(0)
203+
val potientialNewBestBlockNumber: BigInt = (block.number - 1).max(0)
204+
val potientialNewBestBlockHash: ByteString = block.header.parentHash
192205
val newLatestCheckpointNumber: BigInt =
193206
if (block.hasCheckpoint && block.number == latestCheckpointNumber) {
194207
findPreviousCheckpointBlockNumber(block.number, block.number)
@@ -204,8 +217,8 @@ class BlockchainImpl(
204217
into the case of having an incomplete best block and so an inconsistent db
205218
*/
206219
val bestBlockNumberUpdates =
207-
if (appStateStorage.getBestBlockNumber() > newBestBlockNumber)
208-
appStateStorage.putBestBlockNumber(newBestBlockNumber)
220+
if (appStateStorage.getBestBlockNumber() > potientialNewBestBlockNumber)
221+
appStateStorage.putBestBlockData(BestBlockInfo(potientialNewBestBlockHash, potientialNewBestBlockNumber))
209222
else appStateStorage.emptyBatchUpdate
210223
val latestCheckpointNumberUpdates =
211224
if (appStateStorage.getLatestCheckpointBlockNumber() > newLatestCheckpointNumber)
@@ -214,7 +227,7 @@ class BlockchainImpl(
214227

215228
log.debug(
216229
"Persisting app info data into database. Persisted block number is {}. Persisted checkpoint number is {}",
217-
newBestBlockNumber,
230+
potientialNewBestBlockNumber,
218231
newLatestCheckpointNumber
219232
)
220233

@@ -229,11 +242,11 @@ class BlockchainImpl(
229242
.and(latestCheckpointNumberUpdates)
230243
.commit()
231244

232-
saveBestKnownBlocks(newBestBlockNumber, Some(newLatestCheckpointNumber))
245+
saveBestKnownBlocks(potientialNewBestBlockHash, potientialNewBestBlockNumber, Some(newLatestCheckpointNumber))
233246
log.debug(
234247
"Removed block with hash {}. New best block number - {}, new best checkpoint block number - {}",
235248
ByteStringUtils.hash2string(blockHash),
236-
newBestBlockNumber,
249+
potientialNewBestBlockNumber,
237250
newLatestCheckpointNumber
238251
)
239252

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package io.iohk.ethereum.domain
22

3+
import io.iohk.ethereum.domain.appstate.BestBlockInfo
4+
35
import java.util.concurrent.atomic.AtomicReference
46

5-
class BlockchainMetadata(bestBlockNumber: BigInt, latestCheckpointNumber: BigInt) {
7+
class BlockchainMetadata(bestBlockData: BestBlockInfo, latestCheckpointNumber: BigInt) {
68
lazy val bestKnownBlockAndLatestCheckpoint: AtomicReference[BestBlockLatestCheckpointNumbers] =
7-
new AtomicReference(BestBlockLatestCheckpointNumbers(bestBlockNumber, latestCheckpointNumber))
9+
new AtomicReference(BestBlockLatestCheckpointNumbers(bestBlockData, latestCheckpointNumber))
810
}
911

10-
case class BestBlockLatestCheckpointNumbers(bestBlockNumber: BigInt, latestCheckpointNumber: BigInt)
12+
case class BestBlockLatestCheckpointNumbers(bestBlockInfo: BestBlockInfo, latestCheckpointNumber: BigInt)

src/main/scala/io/iohk/ethereum/domain/BlockchainReader.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class BlockchainReader(
8383

8484
def getBestBlockNumber(): BigInt = {
8585
val bestSavedBlockNumber = appStateStorage.getBestBlockNumber()
86-
val bestKnownBlockNumber = blockchainMetadata.bestKnownBlockAndLatestCheckpoint.get().bestBlockNumber
86+
val bestKnownBlockNumber = blockchainMetadata.bestKnownBlockAndLatestCheckpoint.get().bestBlockInfo.number
8787
log.debug(
8888
"Current best saved block number {}. Current best known block number {}",
8989
bestSavedBlockNumber,

src/main/scala/io/iohk/ethereum/domain/BlockchainWriter.scala

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.iohk.ethereum.domain
22

33
import akka.util.ByteString
4-
54
import io.iohk.ethereum.db.dataSource.DataSourceBatchUpdate
65
import io.iohk.ethereum.db.storage.AppStateStorage
76
import io.iohk.ethereum.db.storage.BlockBodiesStorage
@@ -12,6 +11,7 @@ import io.iohk.ethereum.db.storage.ReceiptStorage
1211
import io.iohk.ethereum.db.storage.StateStorage
1312
import io.iohk.ethereum.db.storage.TransactionMappingStorage
1413
import io.iohk.ethereum.db.storage.TransactionMappingStorage.TransactionLocation
14+
import io.iohk.ethereum.domain.appstate.BestBlockInfo
1515
import io.iohk.ethereum.utils.Logger
1616

1717
class BlockchainWriter(
@@ -33,13 +33,13 @@ class BlockchainWriter(
3333
block.header.number,
3434
block.header.number
3535
)
36-
saveBestKnownBlockAndLatestCheckpointNumber(block.header.number, block.header.number)
36+
saveBestKnownBlockAndLatestCheckpointNumber(block.header.hash, block.header.number, block.header.number)
3737
} else if (saveAsBestBlock) {
3838
log.debug(
3939
"New best known block number - {}",
4040
block.header.number
4141
)
42-
saveBestKnownBlock(block.header.number)
42+
saveBestKnownBlock(block.header.hash, block.header.number)
4343
}
4444

4545
log.debug("Saving new block {} to database", block.idTag)
@@ -59,8 +59,10 @@ class BlockchainWriter(
5959
def storeChainWeight(blockHash: ByteString, weight: ChainWeight): DataSourceBatchUpdate =
6060
chainWeightStorage.put(blockHash, weight)
6161

62-
private def saveBestKnownBlock(bestBlockNumber: BigInt): Unit =
63-
blockchainMetadata.bestKnownBlockAndLatestCheckpoint.updateAndGet(_.copy(bestBlockNumber = bestBlockNumber))
62+
private def saveBestKnownBlock(bestBlockHash: ByteString, bestBlockNumber: BigInt): Unit =
63+
blockchainMetadata.bestKnownBlockAndLatestCheckpoint.updateAndGet(v =>
64+
v.copy(bestBlockInfo = BestBlockInfo(bestBlockHash, bestBlockNumber))
65+
)
6466

6567
/** Persists a block in the underlying Blockchain Database
6668
* Note: all store* do not update the database immediately, rather they create
@@ -88,23 +90,27 @@ class BlockchainWriter(
8890
updates.and(transactionMappingStorage.put(tx.hash, TransactionLocation(blockHash, index)))
8991
}
9092

91-
private def saveBestKnownBlockAndLatestCheckpointNumber(number: BigInt, latestCheckpointNumber: BigInt): Unit =
93+
private def saveBestKnownBlockAndLatestCheckpointNumber(
94+
bestBlockHash: ByteString,
95+
number: BigInt,
96+
latestCheckpointNumber: BigInt
97+
): Unit =
9298
blockchainMetadata.bestKnownBlockAndLatestCheckpoint.set(
93-
BestBlockLatestCheckpointNumbers(number, latestCheckpointNumber)
99+
BestBlockLatestCheckpointNumbers(BestBlockInfo(bestBlockHash, number), latestCheckpointNumber)
94100
)
95101

96102
private def persistBestBlocksData: () => Unit = () => {
97-
val currentBestBlockNumber = blockchainMetadata.bestKnownBlockAndLatestCheckpoint.get().bestBlockNumber
103+
val currentBestBlockInfo = blockchainMetadata.bestKnownBlockAndLatestCheckpoint.get().bestBlockInfo
98104
val currentBestCheckpointNumber = blockchainMetadata.bestKnownBlockAndLatestCheckpoint.get().latestCheckpointNumber
99105
log.debug(
100106
"Persisting app info data into database. Persisted block number is {}. " +
101107
"Persisted checkpoint number is {}",
102-
currentBestBlockNumber,
108+
currentBestBlockInfo.number,
103109
currentBestCheckpointNumber
104110
)
105111

106112
appStateStorage
107-
.putBestBlockNumber(currentBestBlockNumber)
113+
.putBestBlockData(currentBestBlockInfo)
108114
.and(appStateStorage.putLatestCheckpointBlockNumber(currentBestCheckpointNumber))
109115
.commit()
110116
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package io.iohk.ethereum.domain.appstate
2+
3+
import akka.util.ByteString
4+
5+
case class BestBlockInfo(hash: ByteString, number: BigInt)

src/main/scala/io/iohk/ethereum/ledger/BlockImport.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,9 @@ class BlockImport(
299299
case BlockData(block, _, _) if block.hasCheckpoint => block.number
300300
}.maximumOption
301301

302-
val bestNumber = oldBranch.last.block.header.number
303-
blockchain.saveBestKnownBlocks(bestNumber, checkpointNumber)
304-
executedBlocks.foreach(data => blockQueue.enqueueBlock(data.block, bestNumber))
302+
val bestHeader = oldBranch.last.block.header
303+
blockchain.saveBestKnownBlocks(bestHeader.hash, bestHeader.number, checkpointNumber)
304+
executedBlocks.foreach(data => blockQueue.enqueueBlock(data.block, bestHeader.number))
305305

306306
newBranch.diff(executedBlocks.map(_.block)).headOption.foreach { block =>
307307
blockQueue.removeSubtree(block.header.hash)

src/main/scala/io/iohk/ethereum/nodebuilder/NodeBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ trait BlockchainBuilder {
176176

177177
private lazy val blockchainMetadata: BlockchainMetadata =
178178
new BlockchainMetadata(
179-
storagesInstance.storages.appStateStorage.getBestBlockNumber(),
179+
storagesInstance.storages.appStateStorage.getBestBlockData(),
180180
storagesInstance.storages.appStateStorage.getLatestCheckpointBlockNumber()
181181
)
182182
lazy val blockchainReader: BlockchainReader = BlockchainReader(storagesInstance.storages, blockchainMetadata)

src/test/scala/io/iohk/ethereum/blockchain/sync/EphemBlockchainTestSetup.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package io.iohk.ethereum.blockchain.sync
22

3+
import io.iohk.ethereum.Fixtures
34
import io.iohk.ethereum.db.components.EphemDataSourceComponent
45
import io.iohk.ethereum.db.components.Storages
56
import io.iohk.ethereum.db.storage.pruning.ArchivePruning
67
import io.iohk.ethereum.db.storage.pruning.PruningMode
78
import io.iohk.ethereum.domain.BlockchainMetadata
9+
import io.iohk.ethereum.domain.appstate.BestBlockInfo
810
import io.iohk.ethereum.ledger.VMImpl
911
import io.iohk.ethereum.nodebuilder.PruningConfigBuilder
1012

@@ -24,5 +26,5 @@ trait EphemBlockchainTestSetup extends ScenarioSetup {
2426
def getNewStorages: EphemDataSourceComponent with LocalPruningConfigBuilder with Storages.DefaultStorages =
2527
new EphemDataSourceComponent with LocalPruningConfigBuilder with Storages.DefaultStorages
2628

27-
def getNewBlockchainMetadata = new BlockchainMetadata(0, 0)
29+
def getNewBlockchainMetadata = new BlockchainMetadata(BestBlockInfo(Fixtures.Blocks.Genesis.header.hash, 0), 0)
2830
}

src/test/scala/io/iohk/ethereum/blockchain/sync/SyncStateSchedulerSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ class SyncStateSchedulerSpec
252252
buildScheduler()
253253
val header = Fixtures.Blocks.ValidBlock.header.copy(stateRoot = worldHash, number = 1)
254254
schedulerBlockchainWriter.storeBlockHeader(header).commit()
255-
schedulerBlockchain.saveBestKnownBlocks(1)
255+
schedulerBlockchain.saveBestKnownBlocks(header.hash, 1)
256256
var state = scheduler.initState(worldHash).get
257257
while (state.activeRequest.nonEmpty) {
258258
val (allMissingNodes1, state2) = scheduler.getAllMissingNodes(state)

src/test/scala/io/iohk/ethereum/blockchain/sync/regular/RegularSyncSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ class RegularSyncSpec
736736
goToTop()
737737

738738
val num: BigInt = 42
739-
blockchain.saveBestKnownBlocks(num, Some(num))
739+
blockchain.saveBestKnownBlocks(testBlocks.head.hash, num, Some(num))
740740

741741
etcPeerManager.expectMsg(GetHandshakedPeers)
742742
etcPeerManager.reply(HandshakedPeers(handshakedPeers))

src/test/scala/io/iohk/ethereum/consensus/pow/validators/StdOmmersValidatorSpec.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ class StdOmmersValidatorSpec extends AnyFlatSpec with Matchers with ScalaCheckPr
464464
.and(blockchainWriter.storeBlock(block95))
465465
.and(blockchainWriter.storeBlock(block96))
466466
.commit()
467-
blockchain.saveBestKnownBlocks(block96.number)
467+
blockchain.saveBestKnownBlocks(block96.hash, block96.number)
468468

469469
}
470470
}

0 commit comments

Comments
 (0)