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

Datablob transactions #1

Draft
wants to merge 61 commits into
base: base
Choose a base branch
from
Draft

Datablob transactions #1

wants to merge 61 commits into from

Conversation

protolambda
Copy link
Owner

@protolambda protolambda commented Feb 19, 2022

This PR tracks the Datablob Eth-Denver diff (building on base, v1.10.16)

  • Proto: Implement data blob tx type (SSZ type, following the updated ethdenver spec)
  • Proto: New "danksigner" to verify signature, get origin, and compute tx hash
  • Proto: Update remote signer api
  • Matt: EVM sharding fork definition
  • Matt: DATAHASH opcode
  • Matt: gas per blob
  • Matt: intrinsic gas update with data hashes
  • Matt: use danksigner in EVM
  • Matt: data blob tx test
  • Proto: transaction pool update blob-size check, placeholder check for blob <> kzg commit <> versioned hash check
  • Proto: implement "txWrapData", optional addition to *Transaction.inner, and encode minimal (for blocks) vs wrapped (default, used in storage, tx pool, journal etc.).
  • Proto: update JSON-RPC for tx wrapper data encoding/decoding
  • Proto: update signer to compute commitments and versioned hashes, signer API caller only provides the blob data
  • Proto: implement SSZ and JSON encoding for blobs and kzg commitments, for network wrapper
  • Proto: update engine API block building
  • Proto/George: update Go-KZG to marshal/unmarshal G1/G2 hex text form (also applies to json)
  • George: Basic KZG functionality needed for danksharding
  • George: KZG trusted setup data + loading + unittest
  • George: blobVerification precompile + test vector (happy case)
  • George: pointEvaluation precompile + test vector (happy case)
  • Matt/Proto: engine API getBlob method (relatively hacky, merging with ExecutionPayload response may make more sense)
  • Proto: don't reinject incomplete blob transactions into tx pool on reorg
  • Proto: work on RLP block encoding, do not encode full blob txs with wrapped data
  • Matt: intrinsic gas check in tx pool considers data blobs now
  • George: isolate minimal KZG code for geth, avoid library import (BLS types left to do)
  • Proto: update engine API with getBlobsBundleV1 as proposed in execution APIs repo
  • Proto: update more signer api types to build blob txs with
  • Proto: update Blob/KZGCommitment/BLSFieldElement types text encoding/decoding. (and Blob is array type now)
  • George: Parse() methods on Blobs/Blob/KZGCommitments/KZGCommitment
  • George: kzg.VerifyBlobs(commitments, blobs) for efficient batch verification.
  • Proto: implement kzg.BlobsBatch to run same batch verification, but aggregate on the fly, to handle batching of many txs
  • Proto: refactor tx wrap-data verification to support vatch-verification
  • Proto: refactor tx pool tx-addition to be more batch-centric, deprecate adding single tx, split validation in stages, and add a blobs batch-verification stage.
  • George: interop bugfixes (missing versioned hashes, use latest signer, etc.)

Consensus layer:

@protolambda protolambda changed the title Datablob transaction type Datablob transactions Feb 20, 2022
@protolambda
Copy link
Owner Author

@terencechain 5fa43da fixes the build issue, and I updated some more of the signer api to build blob transactions. It builds, but still experimental. The surface area to create/sign new transactions is huge, there is a lot to update.

var tmpFr bls.Fr
for i := 0; i < params.FieldElementsPerBlob; i++ {
bls.MulModFr(&tmpFr, &blob[i], randomScalar)
bls.AddModFr(&batch.aggregateBlob[i], &batch.aggregateBlob[i], &tmpFr)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming nitpick: s/aggregateBlob/aggregateScalar

It's not actually a single blob that is aggregated in every aggregateBlob scalar; it's actually all the blobs.

We previously computed it in UnmarshalBinary() but in a wrong way (we considered the wrapped data as part of the inner
length)
@asn-d6
Copy link

asn-d6 commented Mar 22, 2022

A bunch of bug fixes found while developing blobber can be found here: #5

@protolambda
Copy link
Owner Author

protolambda pushed a commit that referenced this pull request Sep 16, 2022
Use minimal transaction format as block codec
protolambda added a commit that referenced this pull request Mar 3, 2023
This commit squashes the op-geth fork history into a more maintainable
diff for rebasing upon upstream geth.

reference-optimistic-geth changes (origins of op-geth in early Bedrock
development stage):
- Deposit TX Type
- Enable deposit tx in EVM/tx pool
- Change deposit nonce to not be the max nonce
- Extend PayloadAttributesV1 with a Transactions field
- Force deposits at the start of each L2 block
- Fix height check
- noTxPool flag, reproduce block in verifier mode without tx pool interference
- Fix RPC json marshalling (ref op-geth PR 4)
- Deposit txs block height check in block body validation (ref op-geth PR 5)
- core: do not try to reinject deposit txs into tx-pool (ref-op-geth PR 6)
- deposit source hash field instead of L2 block height and tx index combination
- Include invalid deposits, rewind state, but always persist mint (ethereum#10)
- Provide gas to Call/Create in deposit transactions (ethereum#12)
- Add docker builds (ref-op-geth PR 16, 17)
- Don't panic on deposit transaction signature values or chain ID (ref-op-geth PR 18)
- core: Add version to DepositTx (ref-op-geth PR 19)
- Enable Geth build/lint/test in CircleCI (ref-op-geth PR 23)
- core: Include guaranteed gas in the gas pool (ref-op-geth PR 21)
- core: handle base fee, l1 availability fee, tx fee (ref-op-geth PR 27)
- fix: deposit tx hash
- fix l1 fee cache, rpc, tracing and tx pool
- core: remove deposit-tx sub-type (a.k.a. deposit version byte)
- eth/catalyst: allow engine user to reorg own chain
- miner: restore ability to reorg deep as block builder
- params: print Optimism consensus type in banner
- core/types: remove unused protected() method, see upstream PR 23376
- core: do not mutate original balance value in tx pool l1 cost adjustment
- core: subtract deposit gas from pool, so other txs do not use the same gas. And fail tx processing if deposits reach gas limit
- core/types: deposits do not tip, avoid basefee subtraction
- Unmeter the L1 Attributes Transaction
- miner: handle force tx errors as critical, clean up diff
- ci: Switch branch
- eth,miner: return STATUS_INVALID when failing to process forced transactions in request (ref-op-geth PR 40)
- verifier: forward tx to sequencer based on flag
- txpool: add flag to disable tx gossip (ref-op-geth PR 42)
- Add op-geth version in addition to geth version (ref-op-geth PR 43)
- ci: CircleCI improvements (ref-op-geth PR 44)
- Rename to op-geth
- Build latest tag on optimism branch

op-geth changes:
- Expose cache config in simulated backend (#2)
- Add EIP-1559 parameters
- eth/catalyst: update payload id computation (#1)
- make eip1559 configurable (#4)
- post-merge network should not log warnings about missing transition information (#5)
- Make the simulator more configurable (ethereum#6)
- fix OPB-6 - IsDepositTx check instead of artificial nonce value check (ethereum#7)
- Simulated backend - enable proof of stake consensus type and fix performance issue (ethereum#8)
- accounts: simulated backend consensus engine option and immediate tx indexing
- consensus/beacon: recognize all blocks as reached TTD with 0 TTD in chain config
- Add --rollup.historicalhttp CLI flag and fix backend iface
- Flags and interfaces for historical RPC requests (ethereum#12)
- Redirect historical RPC requests (ethereum#13)
- Use the pre-existing ethereum.NotFound error (ethereum#18)
- Add historical endpoint to TraceBlockByNumber and TraceBlockByHash (ethereum#19)
- Add historical endpoint to TraceTransaction (ethereum#20)
- Add historical endpoint to TraceCall (ethereum#21)
- optimism: fee params from info txi, update l1 cost func GPO params read (ethereum#15)
- add hardcoded addresses for fee payouts (ethereum#23)
- dynamic gas limit via engine API (ethereum#22)

Co-authored-by: Matthew Slipper <me@matthewslipper.com>
Co-authored-by: Joshua Gutow <jgutow@oplabs.co>
Co-authored-by: protolambda <proto@protolambda.com>
Co-authored-by: Mark Tyneway <mark.tyneway@gmail.com>
Co-authored-by: Maurelian <maurelian@protonmail.ch>
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

Successfully merging this pull request may close these issues.

4 participants