This commit is contained in:
colinlyguo
2023-12-19 14:44:59 +08:00
parent 7c8782b271
commit 5de976ceef
4 changed files with 36 additions and 36 deletions

View File

@@ -1,36 +1,40 @@
{
"L1": {
"confirmation": 2,
"endpoint": "L1-URL",
"startHeight": 4038000,
"blockTime": 12,
"fetchLimit": 32,
"MessengerAddr": "0x50c7d3e7f7c656493D1D76aaa1a836CedfCBB16A",
"ETHGatewayAddr": "0x8A54A2347Da2562917304141ab67324615e9866d",
"WETHGatewayAddr": "0x3dA0BF44814cfC678376b3311838272158211695",
"StandardERC20GatewayAddr": "0x65D123d6389b900d954677c26327bfc1C3e88A13",
"CustomERC20GatewayAddr": "0x31C994F2017E71b82fd4D8118F140c81215bbb37",
"ERC721GatewayAddr": "0xEF27A5E63aa3f1B8312f744b9b4DcEB910Ba77AC",
"ERC1155GatewayAddr": "0xa5Df8530766A85936EE3E139dECE3bF081c83146",
"DAIGatewayAddr": "0x8b0B9c4e9f41b9bbDEfFee24F9f11C328093d248",
"ScrollChainAddr": "0x2D567EcE699Eabe5afCd141eDB7A4f2D0D6ce8a0",
"GatewayRouterAddr": "0x13FBE0D0e5552b8c9c4AE9e2435F38f37355998a",
"MessageQueueAddr": "0xF0B2293F5D834eAe920c6974D50957A1732de763"
"confirmation": 0,
"endpoint": "https://rpc.ankr.com/eth",
"startHeight": 18815938,
"blockTime": 10,
"fetchLimit": 30,
"MessengerAddr": "0x6774Bcbd5ceCeF1336b5300fb5186a12DDD8b367",
"ETHGatewayAddr": "0x7F2b8C31F88B6006c382775eea88297Ec1e3E905",
"WETHGatewayAddr": "0x7AC440cAe8EB6328de4fA621163a792c1EA9D4fE",
"StandardERC20GatewayAddr": "0xD8A791fE2bE73eb6E6cF1eb0cb3F36adC9B3F8f9",
"CustomERC20GatewayAddr": "0xb2b10a289A229415a124EFDeF310C10cb004B6ff",
"ERC721GatewayAddr": "0x6260aF48e8948617b8FA17F4e5CEa2d21D21554B",
"ERC1155GatewayAddr": "0xb94f7F6ABcb811c5Ac709dE14E37590fcCd975B6",
"USDCGatewayAddr": "0xf1AF3b23DE0A5Ca3CAb7261cb0061C0D779A5c7B",
"LIDOGatewayAddr": "0x6625C6332c9F91F2D27c304E729B86db87A3f504",
"DAIGatewayAddr": "0x67260A8B73C5B77B55c1805218A42A7A6F98F515",
"ScrollChainAddr": "0xa13BAF47339d63B743e7Da8741db5456DAc1E556",
"GatewayRouterAddr": "0xF8B1378579659D8F7EE5f3C929c2f3E332E41Fd6",
"MessageQueueAddr": "0x0d7E906BD9cAFa154b048cFa766Cc1E54E39AF9B"
},
"L2": {
"confirmation": 1,
"endpoint": "L2-URL",
"confirmation": 0,
"endpoint": "https://rpc.scroll.io",
"blockTime": 3,
"fetchLimit": 128,
"MessengerAddr": "0xBa50f5340FB9F3Bd074bD638c9BE13eCB36E603d",
"ETHGatewayAddr": "0x91e8ADDFe1358aCa5314c644312d38237fC1101C",
"WETHGatewayAddr": "0x481B20A927206aF7A754dB8b904B052e2781ea27",
"StandardERC20GatewayAddr": "0xaDcA915971A336EA2f5b567e662F5bd74AEf9582",
"CustomERC20GatewayAddr": "0x058dec71E53079F9ED053F3a0bBca877F6f3eAcf",
"ERC721GatewayAddr": "0x179B9415194B67DC3c0b8760E075cD4415785c97",
"ERC1155GatewayAddr": "0xe17C9b9C66FAF07753cdB04316D09f52144612A5",
"DAIGatewayAddr": "0xbF28c28490988026Dca2396148DE50136A54534e",
"GatewayRouterAddr": "0x9aD3c5617eCAa556d6E166787A97081907171230",
"fetchLimit": 100,
"MessengerAddr": "0x781e90f1c8Fc4611c9b7497C3B47F99Ef6969CbC",
"ETHGatewayAddr": "0x6EA73e05AdC79974B931123675ea8F78FfdacDF0",
"WETHGatewayAddr": "0x7003E7B7186f0E6601203b99F7B8DECBfA391cf9",
"StandardERC20GatewayAddr": "0xE2b4795039517653c5Ae8C2A9BFdd783b48f447A",
"CustomERC20GatewayAddr": "0x64CCBE37c9A82D85A1F2E74649b7A42923067988",
"ERC721GatewayAddr": "0x7bC08E1c04fb41d75F1410363F0c5746Eae80582",
"ERC1155GatewayAddr": "0x62597Cc19703aF10B58feF87B0d5D29eFE263bcc",
"USDCGatewayAddr": "0x33B60d5Dd260d453cAC3782b0bDC01ce84672142",
"LIDOGatewayAddr": "0x8aE8f22226B9d789A36AC81474e633f8bE2856c9",
"DAIGatewayAddr": "0xaC78dff3A87b5b534e366A93E785a0ce8fA6Cc62",
"GatewayRouterAddr": "0x4C0926FF5252A435FD19e10ED15e5a249Ba19d79",
"MessageQueueAddr": "0x5300000000000000000000000000000000000000"
},
"db": {
@@ -44,4 +48,4 @@
"password": "",
"db": 0
}
}
}

View File

@@ -94,7 +94,7 @@ func (c *L1MessageFetcher) fetchAndSaveEvents(confirmation uint64) {
return
}
log.Info("fetch and save missing L1 events", "start height", startHeight, "end height", endHeight)
log.Info("fetch and save missing L1 events", "start height", startHeight, "end height", endHeight, "confirmation", confirmation)
for from := startHeight; from <= endHeight; from += c.cfg.FetchLimit {
to := from + c.cfg.FetchLimit - 1
@@ -111,12 +111,10 @@ func (c *L1MessageFetcher) fetchAndSaveEvents(confirmation uint64) {
if isReorg {
log.Warn("L1 reorg happened, exit and re-enter fetchAndSaveEvents", "re-sync height", resyncHeight)
if updateErr := c.updateL1SyncHeight(resyncHeight); updateErr != nil {
log.Error("failed to update L1 sync height", "height", to, "err", updateErr)
return
}
return
}
}

View File

@@ -88,7 +88,7 @@ func (c *L2MessageFetcher) fetchAndSaveEvents(confirmation uint64) {
log.Error("failed to get L2 block number", "confirmation", confirmation, "err", rpcErr)
return
}
log.Info("fetch and save missing L2 events", "start height", startHeight, "end height", endHeight)
log.Info("fetch and save missing L2 events", "start height", startHeight, "end height", endHeight, "confirmation", confirmation)
for from := startHeight; from <= endHeight; from += c.cfg.FetchLimit {
to := from + c.cfg.FetchLimit - 1
@@ -105,12 +105,10 @@ func (c *L2MessageFetcher) fetchAndSaveEvents(confirmation uint64) {
if isReorg {
log.Warn("L2 reorg happened, exit and re-enter fetchAndSaveEvents", "re-sync height", resyncHeight)
if updateErr := c.updateL2SyncHeight(resyncHeight); updateErr != nil {
log.Error("failed to update L2 re-sync height", "height", resyncHeight, "err", updateErr)
return
}
return
}
}

View File

@@ -157,7 +157,7 @@ func (c *CrossMessage) GetMessageSyncedHeightInDB(ctx context.Context, messageTy
}
}
// GetLatestL2WithdrawalLEBlockHeight returns the latest processed L2 withdrawal happened <= given block height from the database.
// GetLatestL2WithdrawalLEBlockHeight returns the latest processed L2 withdrawal that happened <= given block height from the database.
func (c *CrossMessage) GetLatestL2WithdrawalLEBlockHeight(ctx context.Context, blockHeight uint64) (*CrossMessage, error) {
var message CrossMessage
db := c.db.WithContext(ctx)