From e75374a788852d1d8383757b6ba052f4c200e05b Mon Sep 17 00:00:00 2001 From: jianguo Date: Thu, 7 Nov 2024 19:27:11 +0800 Subject: [PATCH] update --- db/sqlite.go | 3 ++- l1infotreesync/processor.go | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/db/sqlite.go b/db/sqlite.go index df0c1d28..63a7ce4a 100644 --- a/db/sqlite.go +++ b/db/sqlite.go @@ -25,7 +25,8 @@ func NewSQLiteDB(dbPath string) (*sql.DB, error) { PRAGMA foreign_keys = ON; pragma journal_mode = WAL; pragma synchronous = normal; - pragma journal_size_limit = 6144000; + PRAGMA synchronous = FULL; + pragma journal_size_limit = 6144000; `) return db, err } diff --git a/l1infotreesync/processor.go b/l1infotreesync/processor.go index 2cd6190c..fb0a9aef 100644 --- a/l1infotreesync/processor.go +++ b/l1infotreesync/processor.go @@ -183,6 +183,7 @@ func (p *processor) GetLatestInfoUntilBlock(ctx context.Context, blockNum uint64 tx, info, `SELECT * FROM l1info_leaf ORDER BY block_num DESC, block_pos DESC LIMIT 1;`, ) + log.Infof("zjg, l1info_leaf select result:%v", err) if err != nil { if errors.Is(err, sql.ErrNoRows) { return nil, db.ErrNotFound @@ -302,6 +303,7 @@ func (p *processor) ProcessBlock(ctx context.Context, block sync.Block) error { } info.GlobalExitRoot = info.globalExitRoot() info.Hash = info.hash() + log.Infof("zjg, insert l1info_leaf:%v", info.Hash.String()) if err = meddler.Insert(tx, "l1info_leaf", info); err != nil { return fmt.Errorf("insert l1info_leaf %s. err: %w", info.String(), err) }