Commit eda69a48 authored by Madhur Shrimal's avatar Madhur Shrimal

emit from the caller

parent e6d58cdc
...@@ -98,6 +98,9 @@ func Main(version string, cliCtx *cli.Context) error { ...@@ -98,6 +98,9 @@ func Main(version string, cliCtx *cli.Context) error {
return fmt.Errorf("error starting RPC server: %w", err) return fmt.Errorf("error starting RPC server: %w", err)
} }
m.RecordInfo(version)
m.RecordUp()
interruptChannel := make(chan os.Signal, 1) interruptChannel := make(chan os.Signal, 1)
signal.Notify(interruptChannel, []os.Signal{ signal.Notify(interruptChannel, []os.Signal{
os.Interrupt, os.Interrupt,
...@@ -117,7 +120,6 @@ type L2OutputSubmitter struct { ...@@ -117,7 +120,6 @@ type L2OutputSubmitter struct {
wg sync.WaitGroup wg sync.WaitGroup
done chan struct{} done chan struct{}
log log.Logger log log.Logger
metricsEnabled bool
metr metrics.Metricer metr metrics.Metricer
ctx context.Context ctx context.Context
...@@ -231,7 +233,6 @@ func NewL2OutputSubmitter(cfg Config, l log.Logger, m metrics.Metricer) (*L2Outp ...@@ -231,7 +233,6 @@ func NewL2OutputSubmitter(cfg Config, l log.Logger, m metrics.Metricer) (*L2Outp
log: l, log: l,
ctx: ctx, ctx: ctx,
cancel: cancel, cancel: cancel,
metricsEnabled: cfg.metricsEnabled,
metr: m, metr: m,
l1Client: cfg.L1Client, l1Client: cfg.L1Client,
...@@ -380,16 +381,6 @@ func (l *L2OutputSubmitter) SendTransaction(ctx context.Context, tx *types.Trans ...@@ -380,16 +381,6 @@ func (l *L2OutputSubmitter) SendTransaction(ctx context.Context, tx *types.Trans
return err return err
} }
if l.metricsEnabled {
// Emit the proposed block Number
block, err := l.rollupClient.OutputAtBlock(ctx, receipt.BlockNumber.Uint64())
if err != nil {
l.log.Warn("unable to fetch block", "block_number", receipt.BlockNumber)
} else {
l.metr.RecordL2BlocksProposed(block.BlockRef)
}
}
// The transaction was successfully submitted // The transaction was successfully submitted
l.log.Info("proposer tx successfully published", "tx_hash", receipt.TxHash) l.log.Info("proposer tx successfully published", "tx_hash", receipt.TxHash)
return nil return nil
...@@ -429,6 +420,7 @@ func (l *L2OutputSubmitter) loop() { ...@@ -429,6 +420,7 @@ func (l *L2OutputSubmitter) loop() {
cancel() cancel()
break break
} else { } else {
l.metr.RecordL2BlocksProposed(output.BlockRef)
cancel() cancel()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment