scroll-tech / go-ethereum

Scroll's fork of the official Go implementation of the Ethereum protocol
GNU Lesser General Public License v3.0
458 stars 262 forks source link

L1sload new design #862

Closed NazariiDenha closed 3 weeks ago

NazariiDenha commented 1 month ago

1. Purpose or design rationale of this PR

Change behavior of l1sload precompile to new design

  1. removed block number
  2. allow multiple storage keys in a single call

To request multiple storage keys in a single call make batch RPC request

2. PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

3. Deployment tag versioning

Has the version in params/version.go been updated?

4. Breaking change label

Does this PR have the breaking-change label?

Turupawn commented 1 month ago

Thanks for adding this :pray: Querying multiple slots at once can help saving gas and also offer good DevEx. I have a couple of questions:

  1. The slots being queried have to been contiguous, all next to each other? Or can they be separate?
  2. The max number of slots queried is 5 right? So 160 bytes.
  3. Why did we decide to remove the block number? Is this to make it simpler, save gas or to reduce load on the scroll nodes? Nothing on top of my mind but I just wonder if we'll leave some use cases behind by doping historic data query
NazariiDenha commented 4 weeks ago
  1. no, they shouldn't be contiguous, they can be separate
  2. yes, for now it's 5. I implemented it following this doc https://github.com/ethereum/RIPs/pull/27. But it can be changed later
  3. If I remember correctly, Haichen mentioned at the protocol meeting that the developers gave feedback that it was not necessary to have block number