Bump nim-eth for revert GasInt back to int64 (#6347)

* Bump nim-eth for revert GasInt back to int64

* Fix libnimbus_lc
This commit is contained in:
andri lim 2024-06-13 20:25:59 +07:00 committed by GitHub
parent 20af24efdb
commit fb0494e739
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 11 deletions

View File

@ -9,6 +9,7 @@
import import
std/[json, sequtils, times], std/[json, sequtils, times],
stew/saturation_arith,
eth/common/[eth_types_rlp, transaction], eth/common/[eth_types_rlp, transaction],
eth/keys, eth/keys,
eth/p2p/discoveryv5/random2, eth/p2p/discoveryv5/random2,
@ -1257,8 +1258,8 @@ proc ETHExecutionBlockHeaderCreateFromJson(
logsBloom: distinctBase(data.logsBloom), logsBloom: distinctBase(data.logsBloom),
difficulty: data.difficulty, difficulty: data.difficulty,
number: distinctBase(data.number), number: distinctBase(data.number),
gasLimit: distinctBase(data.gasLimit), gasLimit: GasInt.saturate distinctBase(data.gasLimit),
gasUsed: distinctBase(data.gasUsed), gasUsed: GasInt.saturate distinctBase(data.gasUsed),
timestamp: EthTime(distinctBase(data.timestamp)), timestamp: EthTime(distinctBase(data.timestamp)),
extraData: distinctBase(data.extraData), extraData: distinctBase(data.extraData),
mixHash: data.mixHash.asEth2Digest, mixHash: data.mixHash.asEth2Digest,
@ -1613,9 +1614,9 @@ proc ETHTransactionsCreateFromJson(
chainId: distinctBase(tx.chainId).u256, chainId: distinctBase(tx.chainId).u256,
`from`: ExecutionAddress(data: fromAddress), `from`: ExecutionAddress(data: fromAddress),
nonce: tx.nonce, nonce: tx.nonce,
maxPriorityFeePerGas: tx.maxPriorityFeePerGas, maxPriorityFeePerGas: tx.maxPriorityFeePerGas.uint64,
maxFeePerGas: tx.maxFeePerGas, maxFeePerGas: tx.maxFeePerGas.uint64,
gas: tx.gasLimit, gas: tx.gasLimit.uint64,
destinationType: destinationType, destinationType: destinationType,
to: ExecutionAddress(data: toAddress), to: ExecutionAddress(data: toAddress),
value: tx.value, value: tx.value,

View File

@ -513,9 +513,9 @@ proc blockToBlockHeader*(blck: ForkyBeaconBlock): ExecutionBlockHeader =
logsBloom : payload.logs_bloom.data, logsBloom : payload.logs_bloom.data,
difficulty : default(DifficultyInt), difficulty : default(DifficultyInt),
number : payload.block_number, number : payload.block_number,
gasLimit : cast[GasInt](payload.gas_limit), gasLimit : GasInt.saturate(payload.gas_limit),
gasUsed : cast[GasInt](payload.gas_used), gasUsed : GasInt.saturate(payload.gas_used),
timestamp : EthTime(int64.saturate payload.timestamp), timestamp : EthTime(payload.timestamp),
extraData : payload.extra_data.asSeq, extraData : payload.extra_data.asSeq,
mixHash : payload.prev_randao, # EIP-4399 `mixHash` -> `prevRandao` mixHash : payload.prev_randao, # EIP-4399 `mixHash` -> `prevRandao`
nonce : default(BlockNonce), nonce : default(BlockNonce),

View File

@ -118,6 +118,8 @@ proc build_empty_merge_execution_payload(state: bellatrix.BeaconState):
bellatrix.ExecutionPayloadForSigning(executionPayload: payload, bellatrix.ExecutionPayloadForSigning(executionPayload: payload,
blockValue: Wei.zero) blockValue: Wei.zero)
from stew/saturating_arith import saturate
proc build_empty_execution_payload( proc build_empty_execution_payload(
state: bellatrix.BeaconState, state: bellatrix.BeaconState,
feeRecipient: Eth1Address): bellatrix.ExecutionPayloadForSigning = feeRecipient: Eth1Address): bellatrix.ExecutionPayloadForSigning =
@ -127,8 +129,8 @@ proc build_empty_execution_payload(
latest = state.latest_execution_payload_header latest = state.latest_execution_payload_header
timestamp = compute_timestamp_at_slot(state, state.slot) timestamp = compute_timestamp_at_slot(state, state.slot)
randao_mix = get_randao_mix(state, get_current_epoch(state)) randao_mix = get_randao_mix(state, get_current_epoch(state))
base_fee = calcEip1599BaseFee(latest.gas_limit, base_fee = calcEip1599BaseFee(GasInt.saturate latest.gas_limit,
latest.gas_used, GasInt.saturate latest.gas_used,
latest.base_fee_per_gas) latest.base_fee_per_gas)
var payload = bellatrix.ExecutionPayloadForSigning( var payload = bellatrix.ExecutionPayloadForSigning(

2
vendor/nim-eth vendored

@ -1 +1 @@
Subproject commit 9b6497ed8a05ba25ee47142f3fc1f61742b51a6c Subproject commit f169068df6c11a2aeba27584c60e354e19c42e94