diff --git a/adapters/sn2core/sn2core.go b/adapters/sn2core/sn2core.go index 8795c671a2..e5508e3ee1 100644 --- a/adapters/sn2core/sn2core.go +++ b/adapters/sn2core/sn2core.go @@ -109,6 +109,7 @@ func AdaptExecutionResources(response *starknet.ExecutionResources) *core.Execut BuiltinInstanceCounter: core.BuiltinInstanceCounter(response.BuiltinInstanceCounter), MemoryHoles: response.MemoryHoles, Steps: response.Steps, + DataAvailability: (*core.DataAvailability)(response.DataAvailability), } } diff --git a/adapters/sn2core/sn2core_test.go b/adapters/sn2core/sn2core_test.go index 0bfa2b2123..26e83f0027 100644 --- a/adapters/sn2core/sn2core_test.go +++ b/adapters/sn2core/sn2core_test.go @@ -104,6 +104,10 @@ func TestAdaptBlock(t *testing.T) { for i, feederReceipt := range response.Receipts { assert.Equal(t, feederReceipt.ExecutionStatus == starknet.Reverted, block.Receipts[i].Reverted) assert.Equal(t, feederReceipt.RevertError, block.Receipts[i].RevertReason) + if feederReceipt.ExecutionResources != nil { + assert.Equal(t, (*core.DataAvailability)(feederReceipt.ExecutionResources.DataAvailability), + block.Receipts[i].ExecutionResources.DataAvailability) + } } } assert.Equal(t, expectedEventCount, block.EventCount) diff --git a/clients/feeder/feeder_test.go b/clients/feeder/feeder_test.go index e363be437d..82d7a8c972 100644 --- a/clients/feeder/feeder_test.go +++ b/clients/feeder/feeder_test.go @@ -330,6 +330,8 @@ func TestBlockHeaderV0131Unmarshal(t *testing.T) { require.Equal(t, utils.HexToFelt(t, "0x3c0c00c87"), block.L1DataGasPrice.PriceInFri) require.Equal(t, starknet.Blob, block.L1DAMode) require.Equal(t, "0.13.1", block.Version) + require.Equal(t, uint64(0), block.Receipts[0].ExecutionResources.DataAvailability.L1Gas) + require.Equal(t, uint64(128), block.Receipts[0].ExecutionResources.DataAvailability.L1DataGas) } func TestClassV0Unmarshal(t *testing.T) { diff --git a/core/transaction.go b/core/transaction.go index 12819da1c1..bb86f54bfb 100644 --- a/core/transaction.go +++ b/core/transaction.go @@ -99,6 +99,12 @@ type ExecutionResources struct { BuiltinInstanceCounter BuiltinInstanceCounter MemoryHoles uint64 Steps uint64 + DataAvailability *DataAvailability +} + +type DataAvailability struct { + L1Gas uint64 + L1DataGas uint64 } type BuiltinInstanceCounter struct { diff --git a/starknet/transaction.go b/starknet/transaction.go index ad0e10232e..e563ba121e 100644 --- a/starknet/transaction.go +++ b/starknet/transaction.go @@ -218,6 +218,12 @@ type ExecutionResources struct { Steps uint64 `json:"n_steps"` BuiltinInstanceCounter BuiltinInstanceCounter `json:"builtin_instance_counter"` MemoryHoles uint64 `json:"n_memory_holes"` + DataAvailability *DataAvailability `json:"data_availability"` +} + +type DataAvailability struct { + L1Gas uint64 `json:"l1_gas"` + L1DataGas uint64 `json:"l1_data_gas"` } type BuiltinInstanceCounter struct {