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

Tmp/new l2geth #1359

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from
Open
11 changes: 5 additions & 6 deletions bus-mapping/src/circuit_input_builder/builder_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,16 @@ impl<P: JsonRpcClient> BuilderClient<P> {
for trace in traces.map(|tr| tr.prestate.clone()) {
for (addr, prestate) in trace.into_iter() {
let (_, storages) = account_set.entry(addr).or_insert_with(|| {
let code_size =
Word::from(prestate.code.as_ref().map(|bt| bt.len()).unwrap_or(0));
let (code_hash, keccak_code_hash) = if let Some(bt) = prestate.code {
let h = CodeDB::hash(&bt);
let code_size = Word::from(prestate.code.len());
let (code_hash, keccak_code_hash) = if !prestate.code.is_empty() {
let h = CodeDB::hash(&prestate.code);
// only require for L2
let keccak_h = if cfg!(feature = "scroll") {
hash_code_keccak(&bt)
hash_code_keccak(&prestate.code)
} else {
h
};
code_set.insert(addr, Vec::from(bt.as_ref()));
code_set.insert(addr, prestate.code.to_vec());
(h, keccak_h)
} else {
(CodeDB::empty_code_hash(), *KECCAK_CODE_HASH_EMPTY)
Expand Down
2 changes: 1 addition & 1 deletion eth-types/src/l2_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ pub struct ExecutionResult {
#[serde(rename = "callTrace")]
pub call_trace: GethCallTrace,
/// prestate
#[serde(default)]
#[serde(rename = "prestateTrace", default)]
pub prestate: HashMap<Address, GethPrestateTrace>,
}

Expand Down
16 changes: 4 additions & 12 deletions eth-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,8 @@ pub struct GethPrestateTrace {
/// nonce
pub nonce: Option<u64>,
/// code
pub code: Option<Bytes>,
#[serde(default)]
pub code: Bytes,
/// storage
pub storage: Option<HashMap<U256, U256>>,
}
Expand Down Expand Up @@ -815,16 +816,7 @@ impl GethCallTrace {
let is_callee_code_empty = self
.to
.as_ref()
.map(|addr| {
!created.contains(addr)
&& prestate
.get(addr)
.unwrap()
.code
.as_ref()
.unwrap()
.is_empty()
})
.map(|addr| !created.contains(addr) && prestate.get(addr).unwrap().code.is_empty())
.unwrap_or(false);

trace.push(FlatGethCallTrace {
Expand All @@ -840,7 +832,7 @@ impl GethCallTrace {
}

let has_output = self.output.as_ref().map(|x| !x.is_empty()).unwrap_or(false);
if call_type.is_create() && has_output {
if call_type.is_create() && self.error.is_none() && has_output {
created.insert(self.to.unwrap());
}
}
Expand Down
1 change: 1 addition & 0 deletions geth-utils/l2geth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
l2gethutil
52 changes: 36 additions & 16 deletions geth-utils/l2geth/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,78 @@ go 1.21

require (
github.com/imdario/mergo v0.3.16
github.com/scroll-tech/go-ethereum v1.10.14-0.20240717120140-0360eba83660
github.com/scroll-tech/go-ethereum v0.0.0-20240807050632-5f35bfe8a7a3
)

require (
github.com/DataDog/zstd v1.4.5 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/VictoriaMetrics/fastcache v1.12.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/btcsuite/btcd v0.20.1-beta // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.0 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/edsrzf/mmap-go v1.0.0 // indirect
github.com/ethereum/c-kzg-4844/bindings/go v0.0.0-20230126171313-363c7d7593b4 // indirect
github.com/deckarep/golang-set/v2 v2.1.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
github.com/ethereum/c-kzg-4844 v1.0.3 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect
github.com/go-kit/kit v0.9.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/uuid v1.1.5 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/holiman/bloomfilter/v2 v2.0.3 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/huin/goupnp v1.0.2 // indirect
github.com/huin/goupnp v1.3.0 // indirect
github.com/iden3/go-iden3-crypto v0.0.16 // indirect
github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.18.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/tsdb v0.10.0 // indirect
github.com/prometheus/client_golang v1.12.0 // indirect
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rjeczalik/notify v0.9.1 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/scroll-tech/zktrie v0.8.4 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4 // indirect
github.com/status-im/keycard-go v0.2.0 // indirect
github.com/supranational/blst v0.3.12 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.8.0 // indirect
github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef // indirect
github.com/tyler-smith/go-bip39 v1.1.0 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
google.golang.org/protobuf v1.33.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
Loading
Loading