bump json-rpc, secp256k1, blscurve, and accompanying fixes
This commit is contained in:
parent
5abf05e455
commit
6cfaaf5b45
|
@ -119,3 +119,10 @@ switch("warning", "ObservableStores:off")
|
||||||
# Too many false positives for "Warning: method has lock level <unknown>, but another method has 0 [LockLevel]"
|
# Too many false positives for "Warning: method has lock level <unknown>, but another method has 0 [LockLevel]"
|
||||||
switch("warning", "LockLevel:off")
|
switch("warning", "LockLevel:off")
|
||||||
|
|
||||||
|
# nimbus-eth1 doesn't use 'news' nor ws client, only websock server. set the backend package to websock.
|
||||||
|
switch("define", "json_rpc_websocket_package:websock")
|
||||||
|
|
||||||
|
if defined(windows) and defined(i386):
|
||||||
|
# avoid undefined reference to 'sqrx_mont_384x' when compiling in 32 bit mode
|
||||||
|
# without actually using __BLST_PORTABLE__ or __BLST_NO_ASM__
|
||||||
|
switch("define", "BLS_FORCE_BACKEND:miracl")
|
||||||
|
|
|
@ -12,7 +12,6 @@ import
|
||||||
std/[times, tables, typetraits, options],
|
std/[times, tables, typetraits, options],
|
||||||
pkg/[chronos,
|
pkg/[chronos,
|
||||||
stew/results,
|
stew/results,
|
||||||
stew/byteutils,
|
|
||||||
chronicles,
|
chronicles,
|
||||||
eth/common,
|
eth/common,
|
||||||
eth/keys,
|
eth/keys,
|
||||||
|
@ -53,9 +52,6 @@ type
|
||||||
signer: EthAddress
|
signer: EthAddress
|
||||||
txPool: TxPoolRef
|
txPool: TxPoolRef
|
||||||
|
|
||||||
template asEthHash(hash: Web3BlockHash): Hash256 =
|
|
||||||
Hash256(data: distinctBase(hash))
|
|
||||||
|
|
||||||
proc validateSealer*(conf: NimbusConf, ctx: EthContext, chain: Chain): Result[void, string] =
|
proc validateSealer*(conf: NimbusConf, ctx: EthContext, chain: Chain): Result[void, string] =
|
||||||
if conf.engineSigner == ZERO_ADDRESS:
|
if conf.engineSigner == ZERO_ADDRESS:
|
||||||
return err("signer address should not zero, use --engine-signer to set signer address")
|
return err("signer address should not zero, use --engine-signer to set signer address")
|
||||||
|
@ -121,7 +117,7 @@ proc prepareBlock(engine: SealingEngineRef,
|
||||||
ok(blk)
|
ok(blk)
|
||||||
|
|
||||||
proc generateBlock(engine: SealingEngineRef,
|
proc generateBlock(engine: SealingEngineRef,
|
||||||
parentBlockHeader: BlockHeader,
|
parentHeader: BlockHeader,
|
||||||
outBlock: var EthBlock,
|
outBlock: var EthBlock,
|
||||||
timestamp = getTime(),
|
timestamp = getTime(),
|
||||||
prevRandao = Hash256()): Result[void, string] =
|
prevRandao = Hash256()): Result[void, string] =
|
||||||
|
@ -129,7 +125,7 @@ proc generateBlock(engine: SealingEngineRef,
|
||||||
# - no DAO hard fork
|
# - no DAO hard fork
|
||||||
# - no local and remote uncles inclusion
|
# - no local and remote uncles inclusion
|
||||||
|
|
||||||
let res = prepareBlock(engine, parentBlockHeader, timestamp, prevRandao)
|
let res = prepareBlock(engine, parentHeader, timestamp, prevRandao)
|
||||||
if res.isErr:
|
if res.isErr:
|
||||||
return err("error prepare header")
|
return err("error prepare header")
|
||||||
|
|
||||||
|
@ -146,24 +142,6 @@ proc generateBlock(engine: SealingEngineRef,
|
||||||
|
|
||||||
ok()
|
ok()
|
||||||
|
|
||||||
proc generateBlock(engine: SealingEngineRef,
|
|
||||||
parentHash: Hash256,
|
|
||||||
outBlock: var EthBlock,
|
|
||||||
timestamp = getTime(),
|
|
||||||
prevRandao = Hash256()): Result[void, string] =
|
|
||||||
var parentBlockHeader: BlockHeader
|
|
||||||
if engine.chain.db.getBlockHeader(parentHash, parentBlockHeader):
|
|
||||||
generateBlock(engine, parentBlockHeader, outBlock, timestamp, prevRandao)
|
|
||||||
else:
|
|
||||||
# TODO:
|
|
||||||
# This hack shouldn't be necessary if the database can find
|
|
||||||
# the genesis block hash in `getBlockHeader`.
|
|
||||||
let maybeGenesisBlock = engine.chain.currentBlock()
|
|
||||||
if parentHash == maybeGenesisBlock.blockHash:
|
|
||||||
generateBlock(engine, maybeGenesisBlock, outBlock, timestamp, prevRandao)
|
|
||||||
else:
|
|
||||||
return err "parent block not found"
|
|
||||||
|
|
||||||
proc generateBlock(engine: SealingEngineRef,
|
proc generateBlock(engine: SealingEngineRef,
|
||||||
outBlock: var EthBlock,
|
outBlock: var EthBlock,
|
||||||
timestamp = getTime(),
|
timestamp = getTime(),
|
||||||
|
|
|
@ -22,7 +22,7 @@ import
|
||||||
./voter_samples as vs,
|
./voter_samples as vs,
|
||||||
eth/[common, keys, p2p, rlp, trie/db],
|
eth/[common, keys, p2p, rlp, trie/db],
|
||||||
ethash,
|
ethash,
|
||||||
secp256k1_abi,
|
secp256k1/abi,
|
||||||
stew/objects
|
stew/objects
|
||||||
|
|
||||||
export
|
export
|
||||||
|
|
|
@ -8,14 +8,14 @@
|
||||||
# those terms.
|
# those terms.
|
||||||
|
|
||||||
import
|
import
|
||||||
std/[json, os, sets, strformat, strutils, typetraits],
|
std/[json, os, sets, strutils, typetraits],
|
||||||
unittest2, nimcrypto, eth/common as eth_common,
|
unittest2, eth/common as eth_common,
|
||||||
json_rpc/[rpcserver, rpcclient], web3/[conversions, engine_api_types],
|
json_rpc/[rpcserver, rpcclient], web3/[engine_api_types],
|
||||||
eth/[trie/db, p2p/private/p2p_types],
|
eth/[trie/db, p2p/private/p2p_types],
|
||||||
../nimbus/sync/protocol,
|
../nimbus/sync/protocol,
|
||||||
../nimbus/rpc/[common, p2p, hexstrings, rpc_types, rpc_utils, engine_api],
|
../nimbus/rpc/[p2p, engine_api],
|
||||||
../nimbus/db/[db_chain],
|
../nimbus/db/[db_chain],
|
||||||
../nimbus/[chain_config, config, context, genesis, sealer],
|
../nimbus/[config, context, genesis, sealer],
|
||||||
../nimbus/utils/[tx_pool],
|
../nimbus/utils/[tx_pool],
|
||||||
../nimbus/p2p/chain,
|
../nimbus/p2p/chain,
|
||||||
../nimbus/merge/mergetypes,
|
../nimbus/merge/mergetypes,
|
||||||
|
@ -138,7 +138,6 @@ proc `==`(a, b: Quantity): bool =
|
||||||
uint64(a) == uint64(b)
|
uint64(a) == uint64(b)
|
||||||
|
|
||||||
proc testEngineApiSupport() =
|
proc testEngineApiSupport() =
|
||||||
var db = newBaseChainDB(newMemoryDB())
|
|
||||||
var api = EngineAPI.new()
|
var api = EngineAPI.new()
|
||||||
let
|
let
|
||||||
id1 = toId(1)
|
id1 = toId(1)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 91253d684d0a2aebe08c2e98677c85387113b854
|
Subproject commit 5bd4a085923d6c3be8ee095d06d1ec8473ebb6aa
|
|
@ -1 +1 @@
|
||||||
Subproject commit 335f292a5816910aebf215e3a88db8a665133e0e
|
Subproject commit d618b555e791a4b1112a2fb1ca1c5c52960f0ae7
|
|
@ -1 +1 @@
|
||||||
Subproject commit d790c42206fab4b8008eaa91181ca8c8c68a0105
|
Subproject commit 5340cf188168d6afcafc8023770d880f067c0b2f
|
Loading…
Reference in New Issue