Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coinbase address does not receive tips after transaction execution #34

Open
Shuwei-Song opened this issue Aug 14, 2024 · 5 comments
Open
Assignees

Comments

@Shuwei-Song
Copy link

Hello,

After executing a transaction, the coinbase address does not receive any tips, meaning its balance does not change as expected.

Steps to Reproduce:
Run any test case, e.g., eip1559.json
Observe the balance of the coinbase address after the transaction execution.

Expected Result:
The coinbase address should receive the appropriate amount of tips, reflecting an increase in its balance.

Actual Result:
The coinbase address's balance remains unchanged.

Please look into this issue. Thank you!

@sbip-sg sbip-sg deleted a comment Aug 19, 2024
@cassc
Copy link
Collaborator

cassc commented Aug 20, 2024

Thanks for submitting the issue! Looks like there is a bug calculating the initial gas limit:

2024-08-20_10-25

tracediff generated from eip1559-splitted.json

@Shuwei-Song
Copy link
Author

@cassc Thanks for your time and support.

I'm afraid we're not discussing the same issue; here are the details of my situation: I'm trying to replay an ETH transfer transaction (0x7720593e098f2289f8e04648cf2381d87402f54bf2a5de67104112a9d041fc68) on CuEVM that was previously executed on the mainchain.

In a blockchain browser (e.g., Etherscan and OKO), it can be noticed that the transaction caused a change in the balances of the three EOAs (sender, receiver and miner).

state

However, replaying the transaction on CuEVM only updates the sender's and receiver's balances, while the coinbase address's balance remains unchanged.

state2

The input JSON file:
input.json

The JSON file output by CuEVM:
output.json

@cassc
Copy link
Collaborator

cassc commented Aug 20, 2024

@Shuwei-Song can you please try the evmcall branch and see if you still got the issue?

 ./out/cpu_debug_interpreter  --input  ~/tmp/input-origin.json --output /dev/stdout

...

{
  "accounts": [
    {
      "address": "0x00192fb10df37c9fb26829eb2cc623cd1bf599e8",
      "balance": "0xc354b52ffb5e625000",
      "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
      "nonce": "0x0",
      "storage": []
    },
    {
      "address": "0x1792bb6d872e97e2164f0e75ccec7dde45e8b734",
      "balance": "0xb1af8ac6803ef3c",
      "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
      "nonce": "0x0",
      "storage": []
    },
    {
      "address": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
      "balance": "0x3e1a6a5e57f0289b14",
      "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
      "nonce": "0x24a4eed",
      "storage": []
    }
  ]
}

@Shuwei-Song
Copy link
Author

@cassc Many thanks for your advice. After switching to the evmcall branch, I get the same output as yours, in which the miner receives tips as expected.

But two new problems arise:

  1. No JSON file is output after executing # ../out/cpu_debug_interpreter --test.json --output test.json.out. While in the main branch, a file named test.json.out can be generated.
  2. After executing make cpu_debug_interpreter, I can get the cpu_debug_interpreter in a few minutes. However, several hours after executing make interpreter, it cannot compile the interpreter and stays at the following lines. (These warnings also appear in make cpu_debug_interpreter, but still get a usable cpu_debug_interpreter.)
# make interpreter
nvcc  -I./CGBN/include -I./bigint -lstdc++ -lm -lgmp -lcjson -rdc=true --std c++20 -lcudadevrt -lineinfo -arch=sm_86 -o ./out/interpreter src/interpreter.cu
src/ecc.cuh(53): warning #1835-D: attribute "__host__" does not apply here

Remark: The warnings can be suppressed with "-diag-suppress <warning-number>"

src/ecc.cuh(54): warning #1835-D: attribute "__host__" does not apply here

src/ecc.cuh(55): warning #1835-D: attribute "__host__" does not apply here

src/tracer.cuh(306): warning #177-D: variable "gas_cost" was declared but never referenced

Remark: The warnings can be suppressed with "-diag-suppress <warning-number>"

src/tracer.cuh(307): warning #177-D: variable "prev_gas_used" was declared but never referenced

src/tracer.cuh(308): warning #177-D: variable "gas_used" was declared but never referenced

src/tracer.cuh(309): warning #177-D: variable "gas_left" was declared but never referenced

src/tracer.cuh(310): warning #177-D: variable "gas_limit" was declared but never referenced

src/alu_operations.cuh(322): warning #177-D: variable "sign" was declared but never referenced

src/ecc.cuh(53): warning #1835-D: attribute "__host__" does not apply here

src/ecc.cuh(54): warning #1835-D: attribute "__host__" does not apply here

src/ecc.cuh(55): warning #1835-D: attribute "__host__" does not apply here

src/interpreter.cu(52): warning #177-D: variable "stack_size" was declared but never referenced

src/ecc.cuh(580): warning #128-D: loop is not reachable
          detected during:
            instantiation of "void ecc::FQP_mul(arith_t &, ecc::FQ<Degree> &, ecc::FQ<Degree> &, ecc::FQ<Degree> &, bn_t &) [with Degree=1UL]" 
(786): here
            instantiation of "__nv_bool ecc::FQP_is_on_curve(arith_t &, ecc::FQ<Degree> &, ecc::FQ<Degree> &, bn_t &, ecc::FQ<Degree> &) [with Degree=1UL]" 
(1228): here

Thank you very much for your time and assistance.

@cassc
Copy link
Collaborator

cassc commented Aug 21, 2024

Hi @Shuwei-Song ,

  1. you can try -o option to get the json output
  2. we are currently still in the process of refactoring / optimizing the GPU version, will update to the main branch once it's stable

cassc pushed a commit that referenced this issue Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants