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

vm: New CallTracer impl and capture more cases in EVM #15

Merged
merged 7 commits into from
Jul 3, 2024

Conversation

blukat29
Copy link
Contributor

@blukat29 blukat29 commented Jun 20, 2024

Proposed changes

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

  • [ ] I have read the CONTRIBUTING GUIDELINES doc
  • I have read the CLA and signed by comment I have read the CLA Document and I hereby sign the CLA in first time contribute
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

  • Please leave the issue numbers or links related to this PR here.

Further comments

Notable changes of callTrace

  • Minor changes
    • The output field is omitted if empty.
    • The value field is sometimes omitted if it equals zero, but sometimes "0x0" is shown.
    • The time field is deleted.
  • Top call frame's gas and gasUsed values agree with transaction and receipts.
 {
   from: "0x7f0546832758f61410e81a94d7a07d55b1dfd278",
-  gas: "0x7b0c",
+  gas: "0xcd14",
   gasUsed: "0x5208",
   input: "0x",
-  output: "0x",
   to: "0xba736c844fd44c380ce19423f9f1ddcb9cd19b6c",
   type: "CALL",
   value: "0x0"
 }
 {
   error: "execution reverted",
   from: "0x7f0546832758f61410e81a94d7a07d55b1dfd278",
-  gas: "0x6fb8",
+  gas: "0xc350",
   gasUsed: "0x6992",
   input: "0x96670644",
   output: "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000962616420696e7075740000000000000000000000000000000000000000000000",
+  revertReason: "bad input",
   reverted: {
     contract: "0xe6c5b1cbf283d9482088136b8cee53fdb6c088eb",
     message: "bad input"
   },
   to: "0xe6c5b1cbf283d9482088136b8cee53fdb6c088eb",
   type: "CALL",
   value: "0x0"
 }
 {
   calls: [{
       from: "0xd94ed12cf3c2eded33adc58a7a09f0b4e0721cd0",
       gas: "0x9b",
       gasUsed: "0x62",
       input: "0xc605f76c",
-      output: "0x",
       to: "0x3d0c6d64907b2ef39e73aa8b08ad8da9b03b9140",
-      type: "DELEGATECALL"
+      type: "DELEGATECALL",
+      value: "0xaa87bee538000"
   }],
 {
+  calls: [{
+      from: "0x813c4bd8a12e427f08e9982c958e0a6d4e05c56f",
+      gas: "0x18c",
+      gasUsed: "0x48",
+      input: "0x998877665544332211",
+      output: "0x1c32777581417de40ff9f685335ce161c493e2528c39742c5327198b95b07320",
+      to: "0x0000000000000000000000000000000000000002",
+      type: "STATICCALL"
+  }],
   from: "0x7f0546832758f61410e81a94d7a07d55b1dfd278",
-  gas: "0x6ad",
+  gas: "0x7fc5",
   gasUsed: "0x7fc5",
   input: "0x9fb83711000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000099988776655443322110000000000000000000000000000000000000000000000",
-  output: "0x",
   to: "0x813c4bd8a12e427f08e9982c958e0a6d4e05c56f",
   type: "CALL",
   value: "0x0"
 }
 {
   calls: [{
-      error: "internal failure",
+      error: "contract address collision",
       from: "0xafe64e2883b6fe56fbdddeef1536e034f2fe6c11",
+      gas: "0x2c2618",
       gasUsed: "0x2c2618",
       input: "0x608060405234801561000f575f80fd5b506040516101523803806101528339818101604052810190610031919061007d565b60648161003e91906100d5565b905050610108565b5f80fd5b5f819050919050565b61005c8161004a565b8114610066575f80fd5b50565b5f8151905061007781610053565b92915050565b5f6020828403121561009257610091610046565b5b5f61009f84828501610069565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6100df8261004a565b91506100ea8361004a565b9250828203905081811115610102576101016100a8565b5b92915050565b603e806101145f395ff3fe60806040525f80fdfea26469706673582212201f37d242bfef7d838ebdb95c50545173bfdb701116ab06c42a6beb267ab5623864736f6c634300081a0033000000000000000000000000000000000000000000000000000000000000007b",
       type: "CREATE2",
       value: "0x0"
   }],
 }
 {
+  from: "0x7f0546832758f61410e81a94d7a07d55b1dfd278",
+  gas: "0xcd14",
   gasUsed: "0xa028",
-  type: "",
+  input: "0x",
+  to: "0x7f0546832758f61410e81a94d7a07d55b1dfd278",
+  type: "CALL",
   value: "0x0"
 }

ian0371
ian0371 previously approved these changes Jun 24, 2024
Co-authored-by: Lewis <lewis.kim@klaytn.foundation>
@blukat29 blukat29 changed the base branch from dev to queue/v1.0.1 July 2, 2024 01:17
@blukat29 blukat29 removed the do not merge Do not merge just yet label Jul 2, 2024
@blukat29
Copy link
Contributor Author

blukat29 commented Jul 2, 2024

@yoomee1313 @JayChoi1736 PTAL

@blukat29 blukat29 mentioned this pull request Jul 2, 2024
22 tasks
@blukat29 blukat29 changed the base branch from queue/v1.0.1 to dev July 3, 2024 00:51
@blukat29 blukat29 merged commit 1380ad3 into dev Jul 3, 2024
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2024
@blukat29 blukat29 deleted the new-calltracer branch July 8, 2024 00:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants