Skip to content

Commit

Permalink
merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
nomaxg committed Nov 29, 2023
2 parents 19873a9 + 1a0a306 commit 03ca08a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 30 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
branches:
- master
- develop
- integration

jobs:
test:
Expand Down Expand Up @@ -126,7 +127,10 @@ jobs:
run: ./scripts/build-brotli.sh -w -d

- name: Build
run: make build test-go-deps -j
run: make build -j

- name: test-go-deps
run: make --debug test-go-deps

- name: Build all lint dependencies
run: make -j build-node-deps
Expand Down Expand Up @@ -169,7 +173,7 @@ jobs:
if: matrix.test-mode == 'challenge'
run: |
packages=`go list ./...`
gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 -- ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -tags=challengetest -run=TestChallenge
gotestsum --format short-verbose --packages="$packages" --rerun-fails=1 -- -timeout 20m ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...,./go-ethereum/... -tags=challengetest -run=TestChallenge
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
Expand Down
52 changes: 25 additions & 27 deletions arbos/block_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,32 @@ func ProduceBlock(
}

hooks := NoopSequencingHooks()

// Espresso-specific validation
// TODO test: https://github.com/EspressoSystems/espresso-sequencer/issues/772
if chainConfig.Espresso {
jst := message.Header.BlockJustification
if jst == nil {
return nil, nil, errors.New("batch missing espresso justification")

}
hotshotHeader := jst.Header
if *lastHotShotCommitment != hotshotHeader.Commit() {
return nil, nil, errors.New("invalid hotshot header")
}
var roots = []*espresso.NmtRoot{&hotshotHeader.TransactionsRoot}
var proofs = []*espresso.NmtProof{&message.Header.BlockJustification.Proof}
// If the validation function below were not mocked, we would need to serialize the transactions
// in the batch here. To avoid the unnecessary overhead, we provide an empty array instead.
var txs []espresso.Bytes
err := espresso.ValidateBatchTransactions(chainConfig.ChainID.Uint64(), roots, proofs, txs)
if err != nil {
return nil, nil, errors.New("failed to validate namespace proof)")
}
}

return ProduceBlockAdvanced(
message.Header, txes, delayedMessagesRead, lastBlockHeader, lastHotShotCommitment, statedb, chainContext, chainConfig, hooks,
message.Header, txes, delayedMessagesRead, lastBlockHeader, statedb, chainContext, chainConfig, hooks,
)
}

Expand All @@ -170,7 +194,6 @@ func ProduceBlockAdvanced(
txes types.Transactions,
delayedMessagesRead uint64,
lastBlockHeader *types.Header,
lastHotShotCommitment *espresso.Commitment,
statedb *state.StateDB,
chainContext core.ChainContext,
chainConfig *params.ChainConfig,
Expand All @@ -194,31 +217,6 @@ func ProduceBlockAdvanced(
l1Timestamp: l1Header.Timestamp,
}

// Espresso-specific validation
// TODO test: https://github.com/EspressoSystems/espresso-sequencer/issues/772
var defaultCommitment espresso.Commitment

if lastHotShotCommitment != nil && !lastHotShotCommitment.Equals(defaultCommitment) {
jst := l1Header.BlockJustification
if jst == nil {
return nil, nil, fmt.Errorf("batch missing espresso justification, provided commitment: %v", lastHotShotCommitment)

}
hotshotHeader := jst.Header
if *lastHotShotCommitment != hotshotHeader.Commit() {
return nil, nil, errors.New("invalid hotshot header")
}
var roots = []*espresso.NmtRoot{&hotshotHeader.TransactionsRoot}
var proofs = []*espresso.NmtProof{&l1Header.BlockJustification.Proof}
// If the validation function below were not mocked, we would need to serialize the transactions
// in the batch here. To avoid the unnecessary overhead, we provide an empty array instead.
var txs []espresso.Bytes
err := espresso.ValidateBatchTransactions(chainConfig.ChainID.Uint64(), roots, proofs, txs)
if err != nil {
return nil, nil, errors.New("failed to validate namespace proof)")
}
}

header := createNewHeader(lastBlockHeader, l1Info, state, chainConfig)
signer := types.MakeSigner(chainConfig, header.Number, header.Time)
// Note: blockGasLeft will diverge from the actual gas left during execution in the event of invalid txs,
Expand Down
1 change: 1 addition & 0 deletions arbos/parse_l2.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

type InfallibleBatchFetcher func(batchNum uint64, batchHash common.Hash) []byte

// TODO: parse espresso justification https://github.com/EspressoSystems/nitro-espresso-integration/pull/14/files
func ParseL2Transactions(msg *arbostypes.L1IncomingMessage, chainId *big.Int, batchFetcher InfallibleBatchFetcher) (types.Transactions, error) {
if len(msg.L2msg) > arbostypes.MaxL2MessageSize {
// ignore the message if l2msg is too large
Expand Down
1 change: 0 additions & 1 deletion execution/gethexec/executionengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ func (s *ExecutionEngine) sequenceTransactionsWithBlockMutex(header *arbostypes.
txes,
delayedMessagesRead,
lastBlockHeader,
nil,
statedb,
s.bc,
s.bc.Config(),
Expand Down

0 comments on commit 03ca08a

Please sign in to comment.