diff --git a/mempool/v1/mempool.go b/mempool/v1/mempool.go index 308390b3b..95aff4599 100644 --- a/mempool/v1/mempool.go +++ b/mempool/v1/mempool.go @@ -257,7 +257,7 @@ func (txmp *TxMempool) RemoveTxByKey(txKey types.TxKey) error { // The caller must hold txmp.mtx excluxively. func (txmp *TxMempool) removeTxByKey(key types.TxKey) error { if elt, ok := txmp.txByKey[key]; ok { - w := elt.Value.(*WrappedTx) + w, _ := elt.Value.(*WrappedTx) delete(txmp.txByKey, key) delete(txmp.txBySender, w.sender) txmp.txs.Remove(elt) diff --git a/settlement/dymension/dymension.go b/settlement/dymension/dymension.go index 0bb52cbed..ca161dcf6 100644 --- a/settlement/dymension/dymension.go +++ b/settlement/dymension/dymension.go @@ -229,7 +229,7 @@ func (d *HubClient) PostBatch(batch *types.Batch, daClient da.Client, daResult * case <-d.ctx.Done(): return d.ctx.Err() default: - err := d.submitBatch(msgUpdateState) + err := d.broadcastBatch(msgUpdateState) if err != nil { d.logger.Error( "Submit batch", @@ -275,7 +275,8 @@ func (d *HubClient) PostBatch(batch *types.Batch, daClient da.Client, daResult * // Check if the batch was accepted by the settlement layer, and we've just missed the event. includedBatch, err := d.pollForBatchInclusion(batch.EndHeight) if err == nil && !includedBatch { - batchAcceptanceAttempts -= 1 + // no error, but still not included + batchAcceptanceAttempts-- if batchAcceptanceAttempts > 0 { timer.Reset(d.batchAcceptanceTimeout) continue @@ -403,7 +404,7 @@ func (d *HubClient) GetSequencers(rollappID string) ([]*types.Sequencer, error) return sequencersList, nil } -func (d *HubClient) submitBatch(msgUpdateState *rollapptypes.MsgUpdateState) error { +func (d *HubClient) broadcastBatch(msgUpdateState *rollapptypes.MsgUpdateState) error { err := d.RunWithRetry(func() error { txResp, err := d.client.BroadcastTx(d.config.DymAccountName, msgUpdateState) if err != nil || txResp.Code != 0 { @@ -421,7 +422,7 @@ func (d *HubClient) eventHandler() { if err != nil { panic("Error subscribing to events") } - //TODO: add defer unsubscribeAll + // TODO: add defer unsubscribeAll for { select {