diff --git a/chains/ethereum/chain.go b/chains/ethereum/chain.go index 1b487cd7..a4756aa3 100644 --- a/chains/ethereum/chain.go +++ b/chains/ethereum/chain.go @@ -59,20 +59,7 @@ func mapToOther(m *chain.Maintainer, latestBlock *big.Int) error { return err } istanbulExtra := mapprotocol.ConvertIstanbulExtra(ist) - var input []byte - if m.Cfg.ApiUrl == "" { - input, err = mapprotocol.PackInput(mapprotocol.Map2Other, mapprotocol.MethodUpdateBlockHeader, h, istanbulExtra, aggPK) - } else { - proof, err := mapprotocol.GetZkProof(m.Cfg.ApiUrl, m.Cfg.Id, latestBlock.Uint64()) - if err != nil { - return err - } - validators, err := mapprotocol.GetCurValidators(m.Conn.Client(), latestBlock) - if err != nil { - return err - } - input, err = mapprotocol.PackInput(mapprotocol.Other, mapprotocol.MethodUpdateBlockHeader, validators, h, istanbulExtra, proof) - } + input, err := mapprotocol.PackInput(mapprotocol.Map2Other, mapprotocol.MethodUpdateBlockHeader, h, istanbulExtra, aggPK) if err != nil { return err } @@ -80,7 +67,6 @@ func mapToOther(m *chain.Maintainer, latestBlock *big.Int) error { msgpayload := []interface{}{input} waitCount := len(m.Cfg.SyncChainIDList) for _, cid := range m.Cfg.SyncChainIDList { - // Only when the latestblock is greater than the height of the synchronized block, the synchronization is performed if v, ok := mapprotocol.SyncOtherMap[cid]; ok && latestBlock.Cmp(v) <= 0 { waitCount-- m.Log.Info("map to other current less than synchronized headerHeight", "toChainId", cid, "synced height", v, diff --git a/internal/chain/block_map2other.go b/internal/chain/block_map2other.go index b01bdb3e..da41b784 100644 --- a/internal/chain/block_map2other.go +++ b/internal/chain/block_map2other.go @@ -3,7 +3,6 @@ package chain import ( "context" "fmt" - "math/big" "strings" "time" @@ -24,8 +23,6 @@ func (w *Writer) execMap2OtherMsg(m msg.Message) bool { case <-w.stop: return false default: - id, _ := m.Payload[0].(*big.Int) - marshal, _ := m.Payload[1].([]byte) err := w.conn.LockAndUpdateOpts(needNonce) if err != nil { w.log.Error("Failed to update nonce", "err", err) @@ -33,13 +30,7 @@ func (w *Writer) execMap2OtherMsg(m msg.Message) bool { continue } - data, err := mapprotocol.PackInput(mapprotocol.LightManger, mapprotocol.MethodUpdateBlockHeader, id, marshal) - if err != nil { - w.log.Error("map2other Failed to pack abi data", "err", err) - w.conn.UnlockOpts() - return false - } - tx, err := w.sendTx(&w.cfg.LightNode, nil, data) + tx, err := w.sendTx(&w.cfg.LightNode, nil, m.Payload[0].([]byte)) w.conn.UnlockOpts() if err == nil { // message successfully handled