Skip to content

Commit

Permalink
differentiate between derivation pipeline and fraud proof preimages
Browse files Browse the repository at this point in the history
  • Loading branch information
afkbyte committed Jun 10, 2024
1 parent 616d94a commit 77922bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion arbstate/inbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ func (e *daProviderForEigenDA) RecoverPayloadFromBatch(
keysetValidationMode KeysetValidationMode,
) ([]byte, error) {
// we start from the 41st byte of sequencerMsg because bytes 0 - 40 are the header, and 40 - 41 is the eigenDA header flag
return eigenda.RecoverPayloadFromEigenDABatch(ctx, sequencerMsg[41:], e.eigenDAReader, preimages)
// we use the binary domain here because this is what we use in the derivation pipeline
return eigenda.RecoverPayloadFromEigenDABatch(ctx, sequencerMsg[41:], e.eigenDAReader, preimages, "binary")
}

type KeysetValidationMode uint8
Expand Down
3 changes: 2 additions & 1 deletion eigenda/eigenda.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ func RecoverPayloadFromEigenDABatch(ctx context.Context,
sequencerMsg []byte, // this is literally the calldata of the transaction/
daReader EigenDAReader,
preimages map[arbutil.PreimageType]map[common.Hash][]byte,
domain string,
) ([]byte, error) {
log.Info("Start recovering payload from eigenda: ", "data", hex.EncodeToString(sequencerMsg))
var eigenDAPreimages map[common.Hash][]byte
Expand All @@ -215,7 +216,7 @@ func RecoverPayloadFromEigenDABatch(ctx context.Context,
blobInfo := ParseSequencerMsg(sequencerMsg)

// default is binary and we want polynomial so we don't need to open 2 points cc @ethen
data, err := daReader.QueryBlob(ctx, blobInfo, "polynomial")
data, err := daReader.QueryBlob(ctx, blobInfo, domain)
if err != nil {
log.Error("Failed to query data from EigenDA", "err", err)
return nil, err
Expand Down
4 changes: 3 additions & 1 deletion staker/stateless_block_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,9 @@ func (v *StatelessBlockValidator) ValidationEntryRecord(ctx context.Context, e *
if v.eigenDAService == nil {
log.Warn("EigenDA not configured, but sequencer message found with EigenDA header")
} else {
_, err := eigenda.RecoverPayloadFromEigenDABatch(ctx, batch.Data[41:], v.eigenDAService, e.Preimages)

// we use the polynomial domain here because this is what we use in the fraud proof pipeline
_, err := eigenda.RecoverPayloadFromEigenDABatch(ctx, batch.Data[41:], v.eigenDAService, e.Preimages, "polynomial")
if err != nil {
return err
}
Expand Down

0 comments on commit 77922bf

Please sign in to comment.