Fix a trivial issue with 'make medalla' and add more logging
This commit is contained in:
parent
be2c2e27f3
commit
d052623381
|
@ -1079,7 +1079,7 @@ programMain:
|
||||||
for node in metadata.bootstrapNodes:
|
for node in metadata.bootstrapNodes:
|
||||||
config.bootstrapNodes.add node
|
config.bootstrapNodes.add node
|
||||||
|
|
||||||
if config.stateSnapshot.isNone:
|
if config.stateSnapshot.isNone and metadata.genesisData.len > 0:
|
||||||
config.stateSnapshotContents = newClone metadata.genesisData
|
config.stateSnapshotContents = newClone metadata.genesisData
|
||||||
|
|
||||||
template checkForIncompatibleOption(flagName, fieldName) =
|
template checkForIncompatibleOption(flagName, fieldName) =
|
||||||
|
|
|
@ -544,7 +544,7 @@ proc findGenesisBlockInRange(m: MainchainMonitor,
|
||||||
secondsPerBlock = float(endBlock.timestamp - startBlock.timestamp) /
|
secondsPerBlock = float(endBlock.timestamp - startBlock.timestamp) /
|
||||||
float(endBlock.number - startBlock.number)
|
float(endBlock.number - startBlock.number)
|
||||||
blocksToJump = max(float(MIN_GENESIS_TIME - startBlockTime) / secondsPerBlock, 1.0)
|
blocksToJump = max(float(MIN_GENESIS_TIME - startBlockTime) / secondsPerBlock, 1.0)
|
||||||
candidateNumber = min(endBlock.number - 1, startBlock.number + blocksToJump.uint64)
|
candidateNumber = min(endBlock.number - 1, startBlock.number + 1) # blocksToJump.uint64)
|
||||||
candidateBlock = await dataProvider.getBlockByNumber(candidateNumber)
|
candidateBlock = await dataProvider.getBlockByNumber(candidateNumber)
|
||||||
|
|
||||||
var candidateAsEth1Block = Eth1Block(number: candidateBlock.number.uint64,
|
var candidateAsEth1Block = Eth1Block(number: candidateBlock.number.uint64,
|
||||||
|
@ -564,6 +564,11 @@ proc findGenesisBlockInRange(m: MainchainMonitor,
|
||||||
else:
|
else:
|
||||||
endBlock = candidateAsEth1Block
|
endBlock = candidateAsEth1Block
|
||||||
|
|
||||||
|
info "Genesis block selected",
|
||||||
|
blockNum = endBlock.number,
|
||||||
|
blockHash = endBlock.voteData.block_hash,
|
||||||
|
blockTime = endBlock.timestamp
|
||||||
|
|
||||||
return endBlock
|
return endBlock
|
||||||
|
|
||||||
proc checkForGenesisLoop(m: MainchainMonitor) {.async.} =
|
proc checkForGenesisLoop(m: MainchainMonitor) {.async.} =
|
||||||
|
@ -577,6 +582,13 @@ proc checkForGenesisLoop(m: MainchainMonitor) {.async.} =
|
||||||
let
|
let
|
||||||
genesisCandidateIdx = genesisCandidateIdx.get
|
genesisCandidateIdx = genesisCandidateIdx.get
|
||||||
genesisCandidate = m.eth1Chain.blocks[genesisCandidateIdx]
|
genesisCandidate = m.eth1Chain.blocks[genesisCandidateIdx]
|
||||||
|
|
||||||
|
info "Generating state for candidate block for genesis",
|
||||||
|
blockNum = genesisCandidate.number,
|
||||||
|
blockHash = genesisCandidate.voteData.block_hash,
|
||||||
|
potentialDeposits = genesisCandidate.voteData.deposit_count
|
||||||
|
|
||||||
|
let
|
||||||
candidateState = m.createBeaconState(genesisCandidate)
|
candidateState = m.createBeaconState(genesisCandidate)
|
||||||
|
|
||||||
if genesisCandidate.knownGoodDepositsCount.get >= m.preset.MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:
|
if genesisCandidate.knownGoodDepositsCount.get >= m.preset.MIN_GENESIS_ACTIVE_VALIDATOR_COUNT:
|
||||||
|
@ -755,7 +767,7 @@ proc run(m: MainchainMonitor, delayBeforeStart: Duration) {.async.} =
|
||||||
url = m.dataProviderFactory.desc
|
url = m.dataProviderFactory.desc
|
||||||
|
|
||||||
await dataProvider.onBlockHeaders do (blk: Eth1BlockHeader)
|
await dataProvider.onBlockHeaders do (blk: Eth1BlockHeader)
|
||||||
{.raises: [Defect], gcsafe}:
|
{.raises: [Defect], gcsafe.}:
|
||||||
try:
|
try:
|
||||||
m.depositQueue.addLastNoWait(blk)
|
m.depositQueue.addLastNoWait(blk)
|
||||||
except AsyncQueueFullError:
|
except AsyncQueueFullError:
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit e558ef88bafb4dd8367aaec01ba89eeec715b761
|
Subproject commit d057d1e5a42c4d14c39e7e3211398ed65bb8aa6c
|
Loading…
Reference in New Issue