Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Remove assembly in geth-utils (#1553)
Browse files Browse the repository at this point in the history
### Description

Remove geth-utils and examples.

### Type of change

New feature (non-breaking change which adds functionality)

### Rationale

- Assembly was introduced in #91 to build examples to use geth-util. It
was not used elsewhere in the codebase.
- The examples are removed as we currently don't use geth-util like the
way the examples show. (Note that the examples also fail to run now. The
transactions in the examples would fail because the trace config
defaults to a 0 block gas limit. It runs after adding a block gas
limit.)
- I found those examples unused when reviewing how we use the tracing
API. It is much easier to review the tracing code after removing the
Assembly.
- The Readme mentioned a TODO CLI, which we never built. I think it
might be interesting to create a good first issue for people to extend
testool(https://github.com/privacy-scaling-explorations/zkevm-circuits/blob/690b2f143a94b7474f0c99493a99b0f2c53d93b8/testool/README.md#L38)
for it.
  • Loading branch information
ChihChengLiang authored Aug 7, 2023
1 parent 68b4f06 commit 3b81787
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 473 deletions.
13 changes: 0 additions & 13 deletions geth-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@

The module `gethutil` tried to provide identical output from APIs `debug_trace*` of latest `geth` as test vectors for [`zkevm-circuits`](https://github.com/privacy-scaling-explorations/zkevm-circuits).

## Usage

<!-- ### CLI Usage -->
<!-- TODO: Implement a CLI to consume bytecode and output logs -->

### Library Usage

For [`./example/mstore_mload.go`](./example/mstore_mload.go) as an example, it defines bytecode directly by builder `asm`, then write the logs produced by `TraceTx` to stdout. To reproduce the logs, run:

```bash
go run ./example/mstore_mload.go > ./mstore_mload.json
```

### Debugging

The execution traces returned by geth omit some information like execution
Expand Down
7 changes: 1 addition & 6 deletions geth-utils/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ fn main() {
}

// Files the lib depends on that should recompile the lib
let dep_files = vec![
"./gethutil/asm.go",
"./gethutil/trace.go",
"./gethutil/util.go",
"./go.mod",
];
let dep_files = vec!["./gethutil/trace.go", "./go.mod"];
for file in dep_files {
println!("cargo:rerun-if-changed={}", file);
}
Expand Down
31 changes: 0 additions & 31 deletions geth-utils/example/add_sub.go

This file was deleted.

31 changes: 0 additions & 31 deletions geth-utils/example/msize.go

This file was deleted.

31 changes: 0 additions & 31 deletions geth-utils/example/mstore_mload.go

This file was deleted.

31 changes: 0 additions & 31 deletions geth-utils/example/sstore_sload.go

This file was deleted.

231 changes: 0 additions & 231 deletions geth-utils/gethutil/asm.go

This file was deleted.

Loading

0 comments on commit 3b81787

Please sign in to comment.