@@ -74,6 +74,7 @@ import (
74
74
"github.com/scroll-tech/go-ethereum/p2p/nat"
75
75
"github.com/scroll-tech/go-ethereum/p2p/netutil"
76
76
"github.com/scroll-tech/go-ethereum/params"
77
+ "github.com/scroll-tech/go-ethereum/rollup/da_syncer"
77
78
"github.com/scroll-tech/go-ethereum/rollup/tracing"
78
79
"github.com/scroll-tech/go-ethereum/rpc"
79
80
)
@@ -871,6 +872,28 @@ var (
871
872
Name : "net.shadowforkpeers" ,
872
873
Usage : "peer ids of shadow fork peers" ,
873
874
}
875
+
876
+ // DA syncing settings
877
+ DASyncEnabledFlag = & cli.BoolFlag {
878
+ Name : "da.sync" ,
879
+ Usage : "Enable node syncing from DA" ,
880
+ }
881
+ DASnapshotFileFlag = & cli.StringFlag {
882
+ Name : "da.snapshot.file" ,
883
+ Usage : "Snapshot file to sync from DA" ,
884
+ }
885
+ DABlobScanAPIEndpointFlag = & cli.StringFlag {
886
+ Name : "da.blob.blobscan" ,
887
+ Usage : "BlobScan blob API endpoint" ,
888
+ }
889
+ DABlockNativeAPIEndpointFlag = & cli.StringFlag {
890
+ Name : "da.blob.blocknative" ,
891
+ Usage : "BlockNative blob API endpoint" ,
892
+ }
893
+ DABeaconNodeAPIEndpointFlag = & cli.StringFlag {
894
+ Name : "da.blob.beaconnode" ,
895
+ Usage : "Beacon node API endpoint" ,
896
+ }
874
897
)
875
898
876
899
// MakeDataDir retrieves the currently requested data directory, terminating
@@ -1315,6 +1338,10 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
1315
1338
setSmartCard (ctx , cfg )
1316
1339
setL1 (ctx , cfg )
1317
1340
1341
+ if ctx .IsSet (DASyncEnabledFlag .Name ) {
1342
+ cfg .DaSyncingEnabled = ctx .Bool (DASyncEnabledFlag .Name )
1343
+ }
1344
+
1318
1345
if ctx .GlobalIsSet (ExternalSignerFlag .Name ) {
1319
1346
cfg .ExternalSigner = ctx .GlobalString (ExternalSignerFlag .Name )
1320
1347
}
@@ -1597,6 +1624,27 @@ func setEnableRollupVerify(ctx *cli.Context, cfg *ethconfig.Config) {
1597
1624
}
1598
1625
}
1599
1626
1627
+ func setDA (ctx * cli.Context , cfg * ethconfig.Config ) {
1628
+ if ctx .IsSet (DASyncEnabledFlag .Name ) {
1629
+ cfg .EnableDASyncing = ctx .Bool (DASyncEnabledFlag .Name )
1630
+ if ctx .IsSet (DAModeFlag .Name ) {
1631
+ cfg .DA .FetcherMode = * flags .GlobalTextMarshaler (ctx , DAModeFlag .Name ).(* da_syncer.FetcherMode )
1632
+ }
1633
+ if ctx .IsSet (DASnapshotFileFlag .Name ) {
1634
+ cfg .DA .SnapshotFilePath = ctx .String (DASnapshotFileFlag .Name )
1635
+ }
1636
+ if ctx .IsSet (DABlobScanAPIEndpointFlag .Name ) {
1637
+ cfg .DA .BlobScanAPIEndpoint = ctx .String (DABlobScanAPIEndpointFlag .Name )
1638
+ }
1639
+ if ctx .IsSet (DABlockNativeAPIEndpointFlag .Name ) {
1640
+ cfg .DA .BlockNativeAPIEndpoint = ctx .String (DABlockNativeAPIEndpointFlag .Name )
1641
+ }
1642
+ if ctx .IsSet (DABeaconNodeAPIEndpointFlag .Name ) {
1643
+ cfg .DA .BeaconNodeAPIEndpoint = ctx .String (DABeaconNodeAPIEndpointFlag .Name )
1644
+ }
1645
+ }
1646
+ }
1647
+
1600
1648
func setMaxBlockRange (ctx * cli.Context , cfg * ethconfig.Config ) {
1601
1649
if ctx .GlobalIsSet (MaxBlockRangeFlag .Name ) {
1602
1650
cfg .MaxBlockRange = ctx .GlobalInt64 (MaxBlockRangeFlag .Name )
@@ -1672,6 +1720,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
1672
1720
setLes (ctx , cfg )
1673
1721
setCircuitCapacityCheck (ctx , cfg )
1674
1722
setEnableRollupVerify (ctx , cfg )
1723
+ setDA (ctx , cfg )
1675
1724
setMaxBlockRange (ctx , cfg )
1676
1725
if ctx .GlobalIsSet (ShadowforkPeersFlag .Name ) {
1677
1726
cfg .ShadowForkPeerIDs = ctx .GlobalStringSlice (ShadowforkPeersFlag .Name )
0 commit comments