@@ -21,9 +21,8 @@ import (
2121)
2222
2323const (
24- flagNamespace = "namespace"
25- flagGasPrice = "gas-price"
26- flagSubmitOpts = "submit-options"
24+ flagNamespace = "namespace"
25+ flagGasPrice = "gas-price"
2726)
2827
2928// PostTxCmd returns a command to post a signed Ethereum transaction to the DA layer
@@ -61,7 +60,6 @@ Examples:
6160 // Add command-specific flags
6261 cobraCmd .Flags ().String (flagNamespace , "" , "DA namespace ID (if not provided, uses config namespace)" )
6362 cobraCmd .Flags ().Float64 (flagGasPrice , - 1 , "Gas price for DA submission (if not provided, uses config gas price)" )
64- cobraCmd .Flags ().String (flagSubmitOpts , "" , "Additional DA submit options (if not provided, uses config submit options)" )
6563
6664 return cobraCmd
6765}
@@ -104,6 +102,11 @@ func postTxRunE(cmd *cobra.Command, args []string) error {
104102 if namespace == "" {
105103 namespace = nodeConfig .DA .GetForcedInclusionNamespace ()
106104 }
105+
106+ if namespace == "" {
107+ return fmt .Errorf ("forced inclusionnamespace cannot be empty" )
108+ }
109+
107110 namespaceBz := da .NamespaceFromString (namespace ).Bytes ()
108111
109112 // Get gas price (use flag if provided, otherwise use config)
@@ -112,16 +115,6 @@ func postTxRunE(cmd *cobra.Command, args []string) error {
112115 return fmt .Errorf ("failed to get gas-price flag: %w" , err )
113116 }
114117
115- // Get submit options (use flag if provided, otherwise use config)
116- submitOpts , err := cmd .Flags ().GetString (flagSubmitOpts )
117- if err != nil {
118- return fmt .Errorf ("failed to get submit-options flag: %w" , err )
119- }
120-
121- if submitOpts == "" {
122- submitOpts = nodeConfig .DA .SubmitOptions
123- }
124-
125118 logger .Info ().Str ("namespace" , namespace ).Float64 ("gas_price" , gasPrice ).Int ("tx_size" , len (txData )).Msg ("posting transaction to DA layer" )
126119
127120 daClient , err := jsonrpc .NewClient (
@@ -139,7 +132,7 @@ func postTxRunE(cmd *cobra.Command, args []string) error {
139132 logger .Info ().Msg ("submitting transaction to DA layer..." )
140133
141134 blobs := [][]byte {txData }
142- options := []byte (submitOpts )
135+ options := []byte (nodeConfig . DA . SubmitOptions )
143136
144137 dac := evblock .NewDAClient (& daClient .DA , nodeConfig , logger )
145138 result := dac .Submit (cmd .Context (), blobs , gasPrice , namespaceBz , options )
@@ -156,7 +149,7 @@ func postTxRunE(cmd *cobra.Command, args []string) error {
156149 genesisPath := filepath .Join (filepath .Dir (nodeConfig .ConfigPath ()), "genesis.json" )
157150 genesis , err := genesispkg .LoadGenesis (genesisPath )
158151 if err != nil {
159- return fmt .Errorf ("failed to load genesis: %w" , err )
152+ return fmt .Errorf ("failed to load genesis for calculating inclusion time estimate : %w" , err )
160153 }
161154
162155 _ , epochEnd , _ := types .CalculateEpochBoundaries (result .Height , genesis .DAStartHeight , genesis .DAEpochForcedInclusion )
@@ -205,7 +198,7 @@ func decodeTxFromJSON(input string) ([]byte, error) {
205198 input = strings .TrimSpace (input )
206199
207200 // Try to decode as JSON with "raw" field
208- var txJSON map [string ]interface {}
201+ var txJSON map [string ]any
209202 if err := json .Unmarshal ([]byte (input ), & txJSON ); err == nil {
210203 if rawTx , ok := txJSON ["raw" ].(string ); ok {
211204 return decodeHexTx (rawTx )
0 commit comments