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 {
return fmt.Errorf("error starting RPC server: %w", err)
}
m.RecordInfo(version)
m.RecordUp()
interruptChannel := make(chan os.Signal, 1)
signal.Notify(interruptChannel, []os.Signal{
os.Interrupt,
......@@ -117,7 +120,6 @@ type L2OutputSubmitter struct {
wg sync.WaitGroup
done chan struct{}
log log.Logger
metricsEnabled bool
metr metrics.Metricer
ctx context.Context
......@@ -231,7 +233,6 @@ func NewL2OutputSubmitter(cfg Config, l log.Logger, m metrics.Metricer) (*L2Outp
log: l,
ctx: ctx,
cancel: cancel,
metricsEnabled: cfg.metricsEnabled,
metr: m,
l1Client: cfg.L1Client,
......@@ -380,16 +381,6 @@ func (l *L2OutputSubmitter) SendTransaction(ctx context.Context, tx *types.Trans
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
l.log.Info("proposer tx successfully published", "tx_hash", receipt.TxHash)
return nil
......@@ -429,6 +420,7 @@ func (l *L2OutputSubmitter) loop() {
cancel()
break
} else {
l.metr.RecordL2BlocksProposed(output.BlockRef)
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