Skip to content

Commit

Permalink
Merge branch 'main' into open-pull-requests-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Jan 6, 2025
2 parents 8620160 + a02b96d commit ac4938d
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"packages/relayer": "0.12.0",
"packages/snaefell-ui": "1.1.0",
"packages/supplementary-contracts": "1.0.0",
"packages/taiko-client": "0.41.1",
"packages/taiko-client": "0.42.0",
"packages/taikoon-ui": "1.3.0",
"packages/ui-lib": "1.0.0"
}
34 changes: 34 additions & 0 deletions packages/taiko-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog

## [0.42.0](https://github.com/taikoxyz/taiko-mono/compare/taiko-alethia-client-v0.41.1...taiko-alethia-client-v0.42.0) (2025-01-06)


### Features

* **taiko-client:** build blob transactions when gas estimation failed ([#18712](https://github.com/taikoxyz/taiko-mono/issues/18712)) ([6c0ef37](https://github.com/taikoxyz/taiko-mono/commit/6c0ef3706ebae8059b9ff554f45c2dcad00c0535))
* **taiko-client:** introduce `TxBuilderWithFallback` ([#18690](https://github.com/taikoxyz/taiko-mono/issues/18690)) ([f1d7b20](https://github.com/taikoxyz/taiko-mono/commit/f1d7b20b722b1e15db3f3f2953c8afb89287537f))
* **taiko-client:** remove an unused flag for proposer ([#18709](https://github.com/taikoxyz/taiko-mono/issues/18709)) ([6fb1fd2](https://github.com/taikoxyz/taiko-mono/commit/6fb1fd25696a5251d864e8869c4a360e9915d787))


### Bug Fixes

* **taiko-client:** add [#18442](https://github.com/taikoxyz/taiko-mono/issues/18442) back ([#18685](https://github.com/taikoxyz/taiko-mono/issues/18685)) ([abc0554](https://github.com/taikoxyz/taiko-mono/commit/abc0554eb0b0a640a8b1a4e9762f7d691b089d40))
* **taiko-client:** add timestamp as a new parameter to getBasefeeV2 ([#18691](https://github.com/taikoxyz/taiko-mono/issues/18691)) ([4a4d908](https://github.com/taikoxyz/taiko-mono/commit/4a4d908b0290046d1098d943a9ebc685c7ca533e))
* **taiko-client:** fix blob transactions estimation when proposing ([#18703](https://github.com/taikoxyz/taiko-mono/issues/18703)) ([395ac5f](https://github.com/taikoxyz/taiko-mono/commit/395ac5fdfb0d8eccae96fafda423d19766a94556))
* **taiko-client:** fix proposing fee estimation ([#18702](https://github.com/taikoxyz/taiko-mono/issues/18702)) ([13a5b1b](https://github.com/taikoxyz/taiko-mono/commit/13a5b1b50e0bf9f030449af49cb0b58ce4288729))


### Chores

* **taiko-client:** add more metrics for `TxBuilderWithFallback` ([#18711](https://github.com/taikoxyz/taiko-mono/issues/18711)) ([b62d390](https://github.com/taikoxyz/taiko-mono/commit/b62d3906a650d8b58ad1d45b068638823ce05121))
* **taiko-client:** add more proof generation metrics ([#18715](https://github.com/taikoxyz/taiko-mono/issues/18715)) ([ae07365](https://github.com/taikoxyz/taiko-mono/commit/ae07365e560c51bcc197335d0ac0ba61964f0b49))
* **taiko-client:** cleanup pre-ontake prover code ([#18677](https://github.com/taikoxyz/taiko-mono/issues/18677)) ([fef6884](https://github.com/taikoxyz/taiko-mono/commit/fef6884bc318e4f09d9c59930a0565cc15e25996))
* **taiko-client:** fix docs ([#18698](https://github.com/taikoxyz/taiko-mono/issues/18698)) ([fc545ee](https://github.com/taikoxyz/taiko-mono/commit/fc545ee89fd907a20161195ef174e7d96d4beae3))
* **taiko-client:** improve prover logs ([#18718](https://github.com/taikoxyz/taiko-mono/issues/18718)) ([3246071](https://github.com/taikoxyz/taiko-mono/commit/32460713052351789f3d7b452ccd0251a000e2f8))
* **taiko-client:** more cost estimation metrics ([#18713](https://github.com/taikoxyz/taiko-mono/issues/18713)) ([b9bd6ea](https://github.com/taikoxyz/taiko-mono/commit/b9bd6ea479da8943b96ddca00a3bbb0e8148774c))
* **taiko-client:** optimize logging ([#18674](https://github.com/taikoxyz/taiko-mono/issues/18674)) ([60bda60](https://github.com/taikoxyz/taiko-mono/commit/60bda60df922e5dd04f6186f8a67d7cb56351c6d))
* **taiko-client:** remove some unused flags ([#18678](https://github.com/taikoxyz/taiko-mono/issues/18678)) ([63f9d26](https://github.com/taikoxyz/taiko-mono/commit/63f9d26b42518a995e093d7db6bc43ef3b57ecca))


### Tests

* **taiko-client:** add more fallback proposing tests ([#18705](https://github.com/taikoxyz/taiko-mono/issues/18705)) ([0e8ef0d](https://github.com/taikoxyz/taiko-mono/commit/0e8ef0d6df36cc05956574b38dabdbbd83f7ce5a))

## [0.41.1](https://github.com/taikoxyz/taiko-mono/compare/taiko-alethia-client-v0.41.0...taiko-alethia-client-v0.41.1) (2024-12-30)


Expand Down
3 changes: 1 addition & 2 deletions packages/taiko-client/driver/chain_syncer/blob/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (s *Syncer) onBlockProposed(

log.Debug(
"Parent block",
"height", parent.Number,
"blockID", parent.Number,
"hash", parent.Hash(),
"beaconSyncTriggered", s.progressTracker.Triggered(),
)
Expand Down Expand Up @@ -286,7 +286,6 @@ func (s *Syncer) onBlockProposed(
log.Info(
"🔗 New L2 block inserted",
"blockID", meta.GetBlockID(),
"height", payloadData.Number,
"hash", payloadData.BlockHash,
"transactions", len(payloadData.Transactions),
"baseFee", utils.WeiToGWei(payloadData.BaseFeePerGas),
Expand Down
6 changes: 3 additions & 3 deletions packages/taiko-client/driver/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (s *State) init(ctx context.Context) error {
s.OnTakeForkHeight = new(big.Int).SetUint64(protocolConfigs.OntakeForkHeight)

log.Info("Genesis L1 height", "height", stateVars.A.GenesisHeight)
log.Info("OnTake fork height", "height", s.OnTakeForkHeight)
log.Info("OnTake fork height", "blockID", s.OnTakeForkHeight)

// Set the L2 head's latest known L1 origin as current L1 sync cursor.
latestL2KnownL1Header, err := s.rpc.LatestL2KnownL1Header(ctx)
Expand All @@ -93,7 +93,7 @@ func (s *State) init(ctx context.Context) error {
return err
}

log.Info("L2 execution engine head", "height", l2Head.Number, "hash", l2Head.Hash())
log.Info("L2 execution engine head", "blockID", l2Head.Number, "hash", l2Head.Hash())
s.setL2Head(l2Head)

s.setHeadBlockID(new(big.Int).SetUint64(stateVars.B.NumBlocks - 1))
Expand Down Expand Up @@ -214,7 +214,7 @@ func (s *State) setL2Head(l2Head *types.Header) {
return
}

log.Trace("New L2 head", "height", l2Head.Number, "hash", l2Head.Hash(), "timestamp", l2Head.Time)
log.Trace("New L2 head", "blockID", l2Head.Number, "hash", l2Head.Hash(), "timestamp", l2Head.Time)
metrics.DriverL2HeadHeightGauge.Set(float64(l2Head.Number.Uint64()))

s.l2Head.Store(l2Head)
Expand Down
18 changes: 18 additions & 0 deletions packages/taiko-client/internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,39 @@ var (
ProverAggregationSubmissionErrorCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_aggregation_submission_error",
})
ProverSGXAggregationGenerationTime = factory.NewGauge(prometheus.GaugeOpts{
Name: "prover_proof_sgx_aggregation_generation_time",
})
ProverSgxProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_sgx_generated",
})
ProverSgxProofGenerationTime = factory.NewGauge(prometheus.GaugeOpts{
Name: "prover_proof_sgx_generation_time",
})
ProverSgxProofAggregationGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_sgx_aggregation_generated",
})
ProverR0AggregationGenerationTime = factory.NewGauge(prometheus.GaugeOpts{
Name: "prover_proof_r0_aggregation_generation_time",
})
ProverR0ProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_r0_generated",
})
ProverR0ProofGenerationTime = factory.NewGauge(prometheus.GaugeOpts{
Name: "prover_proof_r0_generation_time",
})
ProverR0ProofAggregationGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_r0_aggregation_generated",
})
ProverSP1AggregationGenerationTime = factory.NewGauge(prometheus.GaugeOpts{
Name: "prover_proof_sp1_aggregation_generation_time",
})
ProverSp1ProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_sp1_generated",
})
ProverSP1ProofGenerationTime = factory.NewGauge(prometheus.GaugeOpts{
Name: "prover_proof_sp1_generation_time",
})
ProverSp1ProofAggregationGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{
Name: "prover_proof_sp1_aggregation_generated",
})
Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/internal/version/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package version

// Version info.
const Version = "0.18.0" // x-release-please-version
const Version = "0.42.0" // x-release-please-version

var meta = "dev"

Expand Down
2 changes: 1 addition & 1 deletion packages/taiko-client/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "taiko-client",
"version": "0.41.1",
"version": "0.42.0",
"private": true
}
11 changes: 9 additions & 2 deletions packages/taiko-client/proposer/transaction_builder/fallback.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,15 @@ func (b *TxBuilderWithFallback) BuildOntake(
return b.blobTransactionBuilder.BuildOntake(ctx, txListBytesArray)
}

metrics.ProposerEstimatedCostCalldata.Set(float64(costCalldata.Uint64()))
metrics.ProposerEstimatedCostBlob.Set(float64(costBlob.Uint64()))
var (
costCalldataFloat64 float64
costBlobFloat64 float64
)
costCalldataFloat64, _ = utils.WeiToEther(costCalldata).Float64()
costBlobFloat64, _ = utils.WeiToEther(costBlob).Float64()

metrics.ProposerEstimatedCostCalldata.Set(costCalldataFloat64)
metrics.ProposerEstimatedCostBlob.Set(costBlobFloat64)

if costCalldata.Cmp(costBlob) < 0 {
log.Info("Building a type-2 transaction", "costCalldata", costCalldata, "costBlob", costBlob)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func (g *GuardianProofProducer) RequestProof(
"Request guardian proof",
"blockID", blockID,
"coinbase", meta.GetCoinbase(),
"height", header.Number,
"hash", header.Hash(),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func (o *OptimisticProofProducer) RequestProof(
"Request optimistic proof",
"blockID", blockID,
"coinbase", meta.GetCoinbase(),
"height", header.Number,
"hash", header.Hash(),
)

Expand Down
14 changes: 10 additions & 4 deletions packages/taiko-client/prover/proof_producer/sgx_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ func (s *SGXProofProducer) RequestProof(
"Request sgx proof from raiko-host service",
"blockID", blockID,
"coinbase", meta.GetCoinbase(),
"height", header.Number,
"hash", header.Hash(),
"time", time.Since(requestAt),
)

if s.Dummy {
Expand Down Expand Up @@ -137,6 +137,10 @@ func (s *SGXProofProducer) Aggregate(
) (*BatchProofs, error) {
log.Info(
"Aggregate sgx batch proofs from raiko-host service",
"batchSize", len(items),
"firstID", items[0].BlockID,
"lastID", items[len(items)-1].BlockID,
"time", time.Since(requestAt),
)
if len(items) == 0 {
return nil, ErrInvalidLength
Expand Down Expand Up @@ -333,6 +337,7 @@ func (s *SGXProofProducer) requestBatchProof(
"time", time.Since(requestAt),
"producer", "SGXProofProducer",
)
metrics.ProverSGXAggregationGenerationTime.Set(float64(time.Since(requestAt).Seconds()))

return proof, nil
}
Expand All @@ -352,14 +357,14 @@ func (s *SGXProofProducer) callProverDaemon(

output, err := s.requestProof(ctx, opts)
if err != nil {
log.Error("Failed to request proof", "height", opts.BlockID, "error", err, "endpoint", s.RaikoHostEndpoint)
log.Error("Failed to request proof", "blockID", opts.BlockID, "error", err, "endpoint", s.RaikoHostEndpoint)
return nil, err
}

if output == nil {
log.Info(
"Proof generating",
"height", opts.BlockID,
"blockID", opts.BlockID,
"time", time.Since(requestAt),
"producer", "SGXProofProducer",
)
Expand All @@ -386,10 +391,11 @@ func (s *SGXProofProducer) callProverDaemon(

log.Info(
"Proof generated",
"height", opts.BlockID,
"blockID", opts.BlockID,
"time", time.Since(requestAt),
"producer", "SGXProofProducer",
)
metrics.ProverSgxProofGenerationTime.Set(float64(time.Since(requestAt).Seconds()))

return proof, nil
}
Expand Down
23 changes: 19 additions & 4 deletions packages/taiko-client/prover/proof_producer/zkvm_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ func (s *ZKvmProofProducer) RequestProof(
"Request zk proof from raiko-host service",
"blockID", blockID,
"coinbase", meta.GetCoinbase(),
"height", header.Number,
"hash", header.Hash(),
"zk type", s.ZKProofType,
"zkType", s.ZKProofType,
"time", time.Since(requestAt),
)

if s.Dummy {
Expand Down Expand Up @@ -123,6 +123,10 @@ func (s *ZKvmProofProducer) Aggregate(
log.Info(
"Aggregate zkvm batch proofs from raiko-host service",
"zkType", s.ZKProofType,
"batchSize", len(items),
"firstID", items[0].BlockID,
"lastID", items[len(items)-1].BlockID,
"time", time.Since(requestAt),
)
if len(items) == 0 {
return nil, ErrInvalidLength
Expand Down Expand Up @@ -173,7 +177,7 @@ func (s *ZKvmProofProducer) callProverDaemon(

output, err := s.requestProof(zkCtx, opts)
if err != nil {
log.Error("Failed to request proof", "height", opts.BlockID, "error", err, "endpoint", s.RaikoHostEndpoint)
log.Error("Failed to request proof", "blockID", opts.BlockID, "error", err, "endpoint", s.RaikoHostEndpoint)
return nil, err
}

Expand All @@ -192,10 +196,15 @@ func (s *ZKvmProofProducer) callProverDaemon(
}
log.Info(
"Proof generated",
"height", opts.BlockID,
"blockID", opts.BlockID,
"time", time.Since(requestAt),
"producer", "ZKvmProofProducer",
)
if s.ZKProofType == ZKProofTypeR0 {
metrics.ProverR0ProofGenerationTime.Set(float64(time.Since(requestAt).Seconds()))
} else if s.ZKProofType == ZKProofTypeSP1 {
metrics.ProverSP1ProofGenerationTime.Set(float64(time.Since(requestAt).Seconds()))
}

return proof, nil
}
Expand Down Expand Up @@ -510,6 +519,12 @@ func (s *ZKvmProofProducer) requestBatchProof(
"producer", "ZKvmProofProducer",
)

if s.ZKProofType == ZKProofTypeR0 {
metrics.ProverR0AggregationGenerationTime.Set(float64(time.Since(requestAt).Seconds()))
} else if s.ZKProofType == ZKProofTypeSP1 {
metrics.ProverSP1AggregationGenerationTime.Set(float64(time.Since(requestAt).Seconds()))
}

return proof, nil
}

Expand Down
11 changes: 8 additions & 3 deletions packages/taiko-client/prover/proof_submitter/proof_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,9 @@ func (s *ProofSubmitter) BatchSubmitProofs(ctx context.Context, batchProof *proo
log.Info(
"Batch submit block proofs",
"proof", common.Bytes2Hex(batchProof.BatchProof),
"blockIds", batchProof.BlockIDs,
"size", len(batchProof.Proofs),
"firstID", batchProof.BlockIDs[0],
"lastID", batchProof.BlockIDs[len(batchProof.BlockIDs)-1],
"tier", batchProof.Tier,
)
var (
Expand Down Expand Up @@ -479,9 +481,12 @@ func (s *ProofSubmitter) AggregateProofs(ctx context.Context) error {
if err != nil {
if errors.Is(err, proofProducer.ErrProofInProgress) ||
errors.Is(err, proofProducer.ErrRetry) {
log.Info("Aggregating proofs",
log.Info(
"Aggregating proofs",
"status", err,
"length", len(buffer),
"batchSize", len(buffer),
"firstID", buffer[0].BlockID,
"lastID", buffer[len(buffer)-1].BlockID,
"tier", s.Tier(),
)
} else {
Expand Down

0 comments on commit ac4938d

Please sign in to comment.