Skip to content

Commit bdaeedb

Browse files
authored
rename data gas to blob gas (#1659)
* rename data gas to blob gas * bump more submodules * extend evmc tx_context with EIP-4844 blob_hashes
1 parent 221e6c9 commit bdaeedb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+215
-198
lines changed

fluffy/conf.nim

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -240,51 +240,51 @@ func completeCmdArg*(T: type TrustedDigest, input: string): seq[string] =
240240
return @[]
241241

242242
proc parseCmdArg*(T: type enr.Record, p: string): T
243-
{.raises: [ConfigurationError].} =
243+
{.raises: [ValueError].} =
244244
if not fromURI(result, p):
245-
raise newException(ConfigurationError, "Invalid ENR")
245+
raise newException(ValueError, "Invalid ENR")
246246

247247
proc completeCmdArg*(T: type enr.Record, val: string): seq[string] =
248248
return @[]
249249

250250
proc parseCmdArg*(T: type Node, p: string): T
251-
{.raises: [ConfigurationError].} =
251+
{.raises: [ValueError].} =
252252
var record: enr.Record
253253
if not fromURI(record, p):
254-
raise newException(ConfigurationError, "Invalid ENR")
254+
raise newException(ValueError, "Invalid ENR")
255255

256256
let n = newNode(record)
257257
if n.isErr:
258-
raise newException(ConfigurationError, $n.error)
258+
raise newException(ValueError, $n.error)
259259

260260
if n[].address.isNone():
261-
raise newException(ConfigurationError, "ENR without address")
261+
raise newException(ValueError, "ENR without address")
262262

263263
n[]
264264

265265
proc completeCmdArg*(T: type Node, val: string): seq[string] =
266266
return @[]
267267

268268
proc parseCmdArg*(T: type PrivateKey, p: string): T
269-
{.raises: [ConfigurationError].} =
269+
{.raises: [ValueError].} =
270270
try:
271271
result = PrivateKey.fromHex(p).tryGet()
272272
except CatchableError:
273-
raise newException(ConfigurationError, "Invalid private key")
273+
raise newException(ValueError, "Invalid private key")
274274

275275
proc completeCmdArg*(T: type PrivateKey, val: string): seq[string] =
276276
return @[]
277277

278278
proc parseCmdArg*(T: type ClientConfig, p: string): T
279-
{.raises: [ConfigurationError].} =
279+
{.raises: [ValueError].} =
280280
let uri = parseUri(p)
281281
if (uri.scheme == "http" or uri.scheme == "https"):
282282
getHttpClientConfig(p)
283283
elif (uri.scheme == "ws" or uri.scheme == "wss"):
284284
getWebSocketClientConfig(p)
285285
else:
286286
raise newException(
287-
ConfigurationError, "Proxy uri should have defined scheme (http/https/ws/wss)"
287+
ValueError, "Proxy uri should have defined scheme (http/https/ws/wss)"
288288
)
289289

290290
proc completeCmdArg*(T: type ClientConfig, val: string): seq[string] =

fluffy/network/history/history_network.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func validateBlockHeaderBytes*(
209209

210210
let header = ? decodeRlp(bytes, BlockHeader)
211211

212-
if header.excessDataGas.isSome:
212+
if header.excessBlobGas.isSome:
213213
return err("EIP-4844 not yet implemented")
214214

215215
# TODO: Verify timestamp with Shanghai timestamp to if isSome()

fluffy/network/wire/portal_protocol_config.nim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ proc init*(
5454
)
5555

5656
proc parseCmdArg*(T: type RadiusConfig, p: string): T
57-
{.raises: [ConfigurationError].} =
57+
{.raises: [ValueError].} =
5858
if p.startsWith("dynamic") and len(p) == 7:
5959
RadiusConfig(kind: Dynamic)
6060
elif p.startsWith("static:"):
@@ -64,11 +64,11 @@ proc parseCmdArg*(T: type RadiusConfig, p: string): T
6464
uint16.parseCmdArg(num)
6565
except ValueError:
6666
let msg = "Provided logRadius: " & num & " is not a valid number"
67-
raise newException(ConfigurationError, msg)
67+
raise newException(ValueError, msg)
6868

6969
if parsed > 256:
7070
raise newException(
71-
ConfigurationError, "Provided logRadius should be <= 256"
71+
ValueError, "Provided logRadius should be <= 256"
7272
)
7373

7474
RadiusConfig(kind: Static, logRadius: parsed)
@@ -80,11 +80,11 @@ proc parseCmdArg*(T: type RadiusConfig, p: string): T
8080
let msg =
8181
"Not supported radius config option: " & p & " . " &
8282
"Supported options: dynamic and static:logRadius"
83-
raise newException(ConfigurationError, msg)
83+
raise newException(ValueError, msg)
8484

8585
if parsed > 256:
8686
raise newException(
87-
ConfigurationError, "Provided logRadius should be <= 256")
87+
ValueError, "Provided logRadius should be <= 256")
8888

8989
RadiusConfig(kind: Static, logRadius: parsed)
9090

fluffy/tools/beacon_lc_bridge/beacon_lc_bridge.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ proc asPortalBlockData*(
248248
nonce: default(BlockNonce),
249249
fee: some(payload.baseFeePerGas),
250250
withdrawalsRoot: withdrawalsRoot,
251-
dataGasUsed: options.none(uint64),
252-
excessDataGas: options.none(uint64)
251+
blobGasUsed: options.none(uint64),
252+
excessBlobGas: options.none(uint64)
253253
)
254254

255255
headerWithProof = BlockHeaderWithProof(
@@ -293,8 +293,8 @@ proc asPortalBlockData*(
293293
nonce: default(BlockNonce),
294294
fee: some(payload.baseFeePerGas),
295295
withdrawalsRoot: withdrawalsRoot,
296-
dataGasUsed: options.none(uint64),
297-
excessDataGas: options.none(uint64) # TODO: adjust later according to deneb fork
296+
blobGasUsed: options.none(uint64),
297+
excessBlobGas: options.none(uint64) # TODO: adjust later according to deneb fork
298298
)
299299

300300
headerWithProof = BlockHeaderWithProof(

fluffy/tools/beacon_lc_bridge/beacon_lc_bridge_conf.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ type BeaconBridgeConf* = object
170170
name: "direct-peer" .}: seq[string]
171171

172172
proc parseCmdArg*(
173-
T: type Web3Url, p: string): T {.raises: [ConfigurationError].} =
173+
T: type Web3Url, p: string): T {.raises: [ValueError].} =
174174
let
175175
url = parseUri(p)
176176
normalizedScheme = url.scheme.toLowerAscii()
@@ -181,7 +181,7 @@ proc parseCmdArg*(
181181
Web3Url(kind: WsUrl, web3Url: p)
182182
else:
183183
raise newException(
184-
ConfigurationError,
184+
ValueError,
185185
"The Web3 URL must specify one of following protocols: http/https/ws/wss"
186186
)
187187

fluffy/tools/blockwalk.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ type
4040
name: "block-hash" .}: Hash256
4141

4242
proc parseCmdArg*(T: type Hash256, p: string): T
43-
{.raises: [ConfigurationError].} =
43+
{.raises: [ValueError].} =
4444
var hash: Hash256
4545
try:
4646
hexToByteArray(p, hash.data)
4747
except ValueError:
48-
raise newException(ConfigurationError, "Invalid Hash256")
48+
raise newException(ValueError, "Invalid Hash256")
4949

5050
return hash
5151

fluffy/tools/eth_data_exporter/exporter_conf.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ type
184184
discard
185185

186186
proc parseCmdArg*(
187-
T: type Web3Url, p: string): T {.raises: [ConfigurationError].} =
187+
T: type Web3Url, p: string): T {.raises: [ValueError].} =
188188
let
189189
url = parseUri(p)
190190
normalizedScheme = url.scheme.toLowerAscii()
@@ -195,22 +195,22 @@ proc parseCmdArg*(
195195
Web3Url(kind: WsUrl, url: p)
196196
else:
197197
raise newException(
198-
ConfigurationError,
198+
ValueError,
199199
"The Web3 URL must specify one of following protocols: http/https/ws/wss"
200200
)
201201

202202
proc completeCmdArg*(T: type Web3Url, val: string): seq[string] =
203203
return @[]
204204

205205
proc parseCmdArg*(T: type StorageMode, p: string): T
206-
{.raises: [ConfigurationError].} =
206+
{.raises: [ValueError].} =
207207
if p == "db":
208208
return DbStorage
209209
elif p == "json":
210210
return JsonStorage
211211
else:
212212
let msg = "Provided mode: " & p & " is not a valid. Should be `json` or `db`"
213-
raise newException(ConfigurationError, msg)
213+
raise newException(ValueError, msg)
214214

215215
proc completeCmdArg*(T: type StorageMode, val: string): seq[string] =
216216
return @[]

fluffy/tools/portalcli.nim

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,22 @@ type
143143

144144
proc parseCmdArg*(T: type enr.Record, p: string): T =
145145
if not fromURI(result, p):
146-
raise newException(ConfigurationError, "Invalid ENR")
146+
raise newException(ValueError, "Invalid ENR")
147147

148148
proc completeCmdArg*(T: type enr.Record, val: string): seq[string] =
149149
return @[]
150150

151151
proc parseCmdArg*(T: type Node, p: string): T =
152152
var record: enr.Record
153153
if not fromURI(record, p):
154-
raise newException(ConfigurationError, "Invalid ENR")
154+
raise newException(ValueError, "Invalid ENR")
155155

156156
let n = newNode(record)
157157
if n.isErr:
158-
raise newException(ConfigurationError, $n.error)
158+
raise newException(ValueError, $n.error)
159159

160160
if n[].address.isNone():
161-
raise newException(ConfigurationError, "ENR without address")
161+
raise newException(ValueError, "ENR without address")
162162

163163
n[]
164164

@@ -169,7 +169,7 @@ proc parseCmdArg*(T: type PrivateKey, p: string): T =
169169
try:
170170
result = PrivateKey.fromHex(p).tryGet()
171171
except CatchableError:
172-
raise newException(ConfigurationError, "Invalid private key")
172+
raise newException(ValueError, "Invalid private key")
173173

174174
proc completeCmdArg*(T: type PrivateKey, val: string): seq[string] =
175175
return @[]
@@ -178,7 +178,7 @@ proc parseCmdArg*(T: type PortalProtocolId, p: string): T =
178178
try:
179179
result = byteutils.hexToByteArray(p, 2)
180180
except ValueError:
181-
raise newException(ConfigurationError,
181+
raise newException(ValueError,
182182
"Invalid protocol id, not a valid hex value")
183183

184184
proc completeCmdArg*(T: type PortalProtocolId, val: string): seq[string] =

hive_integration/nodocker/consensus/extract_consensus_data.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ proc parseGenesis(n: JsonNode): Genesis =
4545
for x in genFields:
4646
genesis[x] = gen[x]
4747
optionalField("baseFeePerGas", genesis, gen)
48-
optionalField("dataGasUsed", genesis, gen)
49-
optionalField("excessDataGas", genesis, gen)
48+
optionalField("blobGasUsed", genesis, gen)
49+
optionalField("excessBlobGas", genesis, gen)
5050
genesis["alloc"] = n["pre"]
5151
parseGenesis($genesis)
5252

nimbus/common/chain_config.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ type
3535
gasUser* : GasInt
3636
parentHash* : Hash256
3737
baseFeePerGas*: Option[UInt256]
38-
dataGasUsed* : Option[uint64] # EIP-4844
39-
excessDataGas*: Option[uint64] # EIP-4844
38+
blobGasUsed* : Option[uint64] # EIP-4844
39+
excessBlobGas*: Option[uint64] # EIP-4844
4040

4141
GenesisAlloc* = Table[EthAddress, GenesisAccount]
4242
GenesisAccount* = object
@@ -67,8 +67,8 @@ type
6767
gasUser* : GasInt
6868
parentHash* : Hash256
6969
baseFeePerGas*: Option[UInt256]
70-
dataGasUsed* : Option[uint64] # EIP-4844
71-
excessDataGas*: Option[uint64] # EIP-4844
70+
blobGasUsed* : Option[uint64] # EIP-4844
71+
excessBlobGas*: Option[uint64] # EIP-4844
7272

7373
const
7474
CustomNet* = 0.NetworkId

0 commit comments

Comments
 (0)