Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zjg555543 committed Nov 7, 2024
1 parent 16a6ebd commit e75374a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 2 additions & 0 deletions l1infotreesync/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit e75374a

Please sign in to comment.