Skip to content

Commit

Permalink
partly revert "keep fcU consistent with actual DAG"
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed Jun 19, 2022
1 parent 957dd25 commit 1d4a140
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 27 deletions.
49 changes: 49 additions & 0 deletions AllTests-mainnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,23 @@ OK: 2/2 Fail: 0/2 Skip: 0/2
+ parent sanity OK
```
OK: 2/2 Fail: 0/2 Skip: 0/2
## DeleteKeys requests [Preset: mainnet]
```diff
+ Deleting not existing key [Preset: mainnet] OK
+ Invalid Authorization Header [Preset: mainnet] OK
+ Invalid Authorization Token [Preset: mainnet] OK
+ Missing Authorization header [Preset: mainnet] OK
```
OK: 4/4 Fail: 0/4 Skip: 0/4
## DeleteRemoteKeys requests [Preset: mainnet]
```diff
+ Deleting existing local key and remote key [Preset: mainnet] OK
+ Deleting not existing key [Preset: mainnet] OK
+ Invalid Authorization Header [Preset: mainnet] OK
+ Invalid Authorization Token [Preset: mainnet] OK
+ Missing Authorization header [Preset: mainnet] OK
```
OK: 5/5 Fail: 0/5 Skip: 0/5
## Diverging hardforks
```diff
+ Non-tail block in common OK
Expand Down Expand Up @@ -205,6 +222,22 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
+ is_aggregator OK
```
OK: 4/4 Fail: 0/4 Skip: 0/4
## ImportKeystores requests [Preset: mainnet]
```diff
+ ImportKeystores/ListKeystores/DeleteKeystores [Preset: mainnet] OK
+ Invalid Authorization Header [Preset: mainnet] OK
+ Invalid Authorization Token [Preset: mainnet] OK
+ Missing Authorization header [Preset: mainnet] OK
```
OK: 4/4 Fail: 0/4 Skip: 0/4
## ImportRemoteKeys/ListRemoteKeys/DeleteRemoteKeys [Preset: mainnet]
```diff
+ Importing list of remote keys [Preset: mainnet] OK
+ Invalid Authorization Header [Preset: mainnet] OK
+ Invalid Authorization Token [Preset: mainnet] OK
+ Missing Authorization header [Preset: mainnet] OK
```
OK: 4/4 Fail: 0/4 Skip: 0/4
## Interop
```diff
+ Interop genesis OK
Expand Down Expand Up @@ -250,6 +283,22 @@ OK: 3/3 Fail: 0/3 Skip: 0/3
+ Sync [Preset: mainnet] OK
```
OK: 6/6 Fail: 0/6 Skip: 0/6
## ListKeys requests [Preset: mainnet]
```diff
+ Correct token provided [Preset: mainnet] OK
+ Invalid Authorization Header [Preset: mainnet] OK
+ Invalid Authorization Token [Preset: mainnet] OK
+ Missing Authorization header [Preset: mainnet] OK
```
OK: 4/4 Fail: 0/4 Skip: 0/4
## ListRemoteKeys requests [Preset: mainnet]
```diff
+ Correct token provided [Preset: mainnet] OK
+ Invalid Authorization Header [Preset: mainnet] OK
+ Invalid Authorization Token [Preset: mainnet] OK
+ Missing Authorization header [Preset: mainnet] OK
```
OK: 4/4 Fail: 0/4 Skip: 0/4
## Message signatures
```diff
+ Aggregate and proof signatures OK
Expand Down
4 changes: 2 additions & 2 deletions beacon_chain/eth1/eth1_monitor.nim
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ proc exchangeTransitionConfiguration*(p: Eth1Monitor): Future[void] {.async.} =
p.terminalBlockNumber.get
else:
# https://github.com/nim-lang/Nim/issues/19802
(static(default(Quantity)))
(static(default(Quantity))))
let ecTransitionConfiguration =
await p.dataProvider.web3.provider.engine_exchangeTransitionConfigurationV1(
ccTransitionConfiguration)
Expand Down Expand Up @@ -1403,6 +1403,7 @@ proc startEth1Syncing(m: Eth1Monitor, delayBeforeStart: Duration) {.async.} =
if expectedNetwork != providerNetwork:
fatal "The specified web3 provider serves data for a different network",
expectedNetwork, providerNetwork
quit 1

var mustUsePolling = m.forcePolling or
web3Url.startsWith("https://") or
Expand Down Expand Up @@ -1436,7 +1437,6 @@ proc startEth1Syncing(m: Eth1Monitor, delayBeforeStart: Duration) {.async.} =
let startBlock = awaitWithRetries(
m.dataProvider.getBlockByHash(m.depositsChain.finalizedBlockHash.asBlockHash))

doAssert m.depositsChain.blocks.len == 0
m.depositsChain.addBlock Eth1Block(
number: Eth1BlockNumber startBlock.number,
timestamp: Eth1BlockTimestamp startBlock.timestamp,
Expand Down
2 changes: 1 addition & 1 deletion beacon_chain/gossip_processing/block_processor.nim
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ proc runQueueProcessingLoop*(self: ref BlockProcessor) {.async.} =
executionPayloadStatus

await self.runForkchoiceUpdated(
self.consensusManager.dag.head.executionBlockRoot,
blck.blck.bellatrixData.message.body.execution_payload.block_hash,
self.consensusManager.dag.finalizedHead.blck.executionBlockRoot)

if not blck.resfut.isNil:
Expand Down
25 changes: 2 additions & 23 deletions beacon_chain/nimbus_beacon_node.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1318,25 +1318,14 @@ proc onSecond(node: BeaconNode, time: Moment) =
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.9/src/engine/specification.md#engine_exchangetransitionconfigurationv1
if time > node.nextExchangeTransitionConfTime and not node.eth1Monitor.isNil:
node.nextExchangeTransitionConfTime = time + chronos.minutes(1)
traceAsyncErrors node.eth1Monitor.exchangeTransitionConfiguration()
if node.currentSlot.epoch >= node.dag.cfg.BELLATRIX_FORK_EPOCH:
traceAsyncErrors node.eth1Monitor.exchangeTransitionConfiguration()

if node.config.stopAtSyncedEpoch != 0 and
node.dag.head.slot.epoch >= node.config.stopAtSyncedEpoch:
notice "Shutting down after having reached the target synced epoch"
bnStatus = BeaconNodeStatus.Stopping

proc onMinute(node: BeaconNode) {.async.} =
## This procedure will be called once per minute.
# https://github.com/ethereum/execution-apis/blob/v1.0.0-alpha.8/src/engine/specification.md#engine_exchangetransitionconfigurationv1
if not node.eth1Monitor.isNil and
node.currentSlot.epoch >= node.dag.cfg.BELLATRIX_FORK_EPOCH:
try:
# TODO could create a bool-succeed-or-not interface to this function
await node.eth1Monitor.exchangeTransitionConfiguration()
except CatchableError as exc:
debug "onMinute: exchangeTransitionConfiguration failed",
error = exc.msg

proc runOnSecondLoop(node: BeaconNode) {.async.} =
const
sleepTime = chronos.seconds(1)
Expand All @@ -1352,15 +1341,6 @@ proc runOnSecondLoop(node: BeaconNode) {.async.} =
ticks_delay.set(sleepTime.nanoseconds.float / nanosecondsIn1s)
trace "onSecond task completed", sleepTime, processingTime

proc runOnMinuteLoop(node: BeaconNode) {.async.} =
const
sleepTime = chronos.seconds(60)
nanosecondsIn60s = float(sleepTime.nanoseconds)
while true:
await chronos.sleepAsync(sleepTime)
await node.onMinute()
trace "onMinute task completed"

func connectedPeersCount(node: BeaconNode): int =
len(node.network.peerPool)

Expand Down Expand Up @@ -1525,7 +1505,6 @@ proc run(node: BeaconNode) {.raises: [Defect, CatchableError].} =

asyncSpawn runSlotLoop(node, wallTime, onSlotStart)
asyncSpawn runOnSecondLoop(node)
asyncSpawn runOnMinuteLoop(node)
asyncSpawn runQueueProcessingLoop(node.blockProcessor)

## Ctrl+C handling
Expand Down
2 changes: 1 addition & 1 deletion beacon_chain/validators/keystore_management.nim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export
when defined(windows):
import stew/[windows/acl]

{.localPassC: "-fno-lto".} # no LTO for crypto
{.localPassc: "-fno-lto".} # no LTO for crypto

const
KeystoreFileName* = "keystore.json"
Expand Down

0 comments on commit 1d4a140

Please sign in to comment.