Skip to content

Commit

Permalink
Merge pull request #245 from eosnetworkfoundation/elmato/update-silkw…
Browse files Browse the repository at this point in the history
…orm-1-0-2

[1.0] Update silkworm 1.0.2
  • Loading branch information
elmato authored Jun 28, 2024
2 parents 61de204 + 90f52cc commit 0067715
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions tests/nodeos_eos_evm_different_token_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,8 @@ def get_block(num):
Utils.Print("\taccount row4: ", row4)
bal2 = w3.eth.get_balance(Web3.to_checksum_address("0x9E126C57330FA71556628e0aabd6B6B6783d99fA"))

# balance different = 1.0 EOS (val) + 900(Gwei) (21000(base gas) + 36782 (gas for non-exist account) )
assert(bal1 == bal2 + 1000000000000000000 + 900000000000 * (21000 + 36782))
# balance different = 1.0 EOS (val) + 900(Gwei) (21000(base gas))
assert(bal1 == bal2 + 1000000000000000000 + 900000000000 * 21000)

# Wait 3 mins
Utils.Print("Wait 3 mins")
Expand Down
16 changes: 8 additions & 8 deletions tests/nodeos_eos_evm_gasparam_fork_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,8 +713,8 @@ def makeReservedEvmAddress(account):
Utils.Print("\taccount row4: ", row4)

assert(row4["eth_address"] == "9e126c57330fa71556628e0aabd6b6b6783d99fa")
assert(row4["balance"] == "0000000000000000000000000000000000000000000000024c9336a8ead00600")
# diff = 2,897,785,000,000,000 = 2,897,785 (Gwei) = (100,000 + (165519 + 21000) * 15) (Gwei)
assert(row4["balance"] == "0000000000000000000000000000000000000000000000024c9c08bd58ca9000")
# diff = 415,000,000,000,000 = 415,000 (Gwei) = (100,000 + (21000) * 15) (Gwei)
# {"ram_price_mb":"5.0000 EOS","gas_price":10000000000}
# {'consensusParameter': AttributeDict({'gasFeeParameters': AttributeDict({'gasCodedeposit': 477, 'gasNewaccount': 165519, 'gasSset': 167942, 'gasTxcreate': 289062, 'gasTxnewaccount': 165519}

Expand Down Expand Up @@ -895,11 +895,11 @@ def makeReservedEvmAddress(account):
time.sleep(2)

Utils.Print("Transfer funds to trigger gas parameter in minor fork")
# EVM -> EOS
# EVM -> EVM
# 0x9E126C57330FA71556628e0aabd6B6B6783d99fA private key: 0xba8c9ff38e4179748925335a9891b969214b37dc3723a1754b8b849d3eea9ac0
toAdd = makeReservedEvmAddress(convert_name_to_value(bobAcc.name))
toAdd = 0x4ce0ca184bc155a5df5dae2f4643cba60eb1a9ed
evmSendKey = "ba8c9ff38e4179748925335a9891b969214b37dc3723a1754b8b849d3eea9ac0"
Print("Transfer EVM->EOS funds 1Gwei from account %s to %s" % (evmAcc.name, bobAcc.name))
Print("Transfer EVM->EVM funds 1Gwei from account %s to %s" % (evmAcc.name, toAdd))
nonce = 1
gasP = getGasPrice()
signed_trx = w3.eth.account.sign_transaction(dict(
Expand All @@ -921,7 +921,7 @@ def makeReservedEvmAddress(account):
Utils.Print("\taccount row4 in node0: ", row4)

assert(row4["eth_address"] == "9e126c57330fa71556628e0aabd6b6b6783d99fa")
assert(row4["balance"] == "0000000000000000000000000000000000000000000000024c8724aef459cc00")
assert(row4["balance"] == "0000000000000000000000000000000000000000000000024c8ff6c362545600")

# push the same transaction to node1's minor fork (prodc)
trans = node1.pushMessage(evmAcc.name, "pushtx", json.dumps(actData), '-p {0}'.format(minerAcc.name), silentErrors=False)
Expand All @@ -930,7 +930,7 @@ def makeReservedEvmAddress(account):
row4_node1=node1.getTableRow(evmAcc.name, evmAcc.name, "account", 4)
Utils.Print("\taccount row4 in node1: ", row4_node1)
assert(row4_node1["eth_address"] == "9e126c57330fa71556628e0aabd6b6b6783d99fa")
assert(row4_node1["balance"] == "0000000000000000000000000000000000000000000000024c88eb23c5408c00")
assert(row4_node1["balance"] == "0000000000000000000000000000000000000000000000024c91bd38333b1600")
assert(row4["balance"] != row4_node1["balance"])

# verify eos-evm-node get the new gas parameter from the minor fork
Expand Down Expand Up @@ -1035,7 +1035,7 @@ def makeReservedEvmAddress(account):
Utils.Print("\taccount row4 in node0: ", row4)

assert(row4["eth_address"] == "9e126c57330fa71556628e0aabd6b6b6783d99fa")
assert(row4["balance"] == "0000000000000000000000000000000000000000000000024c88eb23c5408c00")
assert(row4["balance"] == "0000000000000000000000000000000000000000000000024c91bd38333b1600")
assert(row4["balance"] == row4_node1["balance"])

evm_block = w3.eth.get_block('latest')
Expand Down
4 changes: 2 additions & 2 deletions tests/nodeos_eos_evm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -939,8 +939,8 @@ def get_block(num):
Utils.Print("\tverify balance from evm-rpc, account row4: ", row4)
bal2 = w3.eth.get_balance(Web3.to_checksum_address("0x9E126C57330FA71556628e0aabd6B6B6783d99fA"))

# balance different = 1.0 EOS (val) + 900(Gwei) (21000(base gas) + 36782 (gas for non-exist account) )
assert(bal1 == bal2 + 1000000000000000000 + 900000000000 * (21000 + 36782))
# balance different = 1.0 EOS (val) + 900(Gwei) (21000(base gas))
assert(bal1 == bal2 + 1000000000000000000 + 900000000000 * 21000)

Utils.Print("try to get transaction %s from evm-rpc" % (Web3.to_hex(signed_trx.hash)))
evm_tx = w3.eth.get_transaction(signed_trx.hash)
Expand Down

0 comments on commit 0067715

Please sign in to comment.