Skip to content

Commit 4988ef5

Browse files
authored
Merge branch 'main' into rianhughes/tendermint-block-proposer
2 parents 3598b70 + 7d64642 commit 4988ef5

File tree

6 files changed

+69
-24
lines changed

6 files changed

+69
-24
lines changed

.github/workflows/benchmark-sync.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Benchmark Sync
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * 0' # Every Sunday at midnight UTC
7+
8+
permissions:
9+
contents: read
10+
11+
env:
12+
DOCKER_REGISTRY: nethermind.jfrog.io
13+
IMAGE_REPO: nubia-oci-local-dev/juno
14+
BENCHMARK_TAG: nubia-oci-local-dev/juno-benchmark:latest
15+
16+
jobs:
17+
sync-benchmark:
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Extract Git version
27+
id: extract_version
28+
run: echo "version=$(git describe --tags)" >> $GITHUB_OUTPUT
29+
30+
- name: Setup Docker Buildx
31+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
32+
id: buildx
33+
34+
- name: Login to registry
35+
run: docker login ${{ env.DOCKER_REGISTRY }} -u ${{ secrets.ARTIFACTORY_NUBIA_USERNAME }} -p ${{ secrets.ARTIFACTORY_NUBIA_TOKEN_DEVELOPER }}
36+
37+
- name: Create benchmark tag
38+
run: docker buildx imagetools create -t ${{ env.DOCKER_REGISTRY }}/${{ env.BENCHMARK_TAG }} ${{ env.DOCKER_REGISTRY }}/${{ env.IMAGE_REPO }}:${{ steps.extract_version.outputs.version }}
39+
40+
- name: Log out from Docker registry
41+
run: docker logout ${{ env.DOCKER_REGISTRY }}

.github/workflows/deploy-and-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797
needs: [deploy]
9898
uses: ./.github/workflows/starknet-rs-tests.yml
9999
secrets:
100-
STARKNET_RPC: ${{ secrets.RPC_URL }}/v0_7?apikey=${{ secrets.AUTH_TOKEN }}
100+
STARKNET_RPC: ${{ secrets.RPC_URL }}/v0_8?apikey=${{ secrets.AUTH_TOKEN }}
101101

102102
starknet-js:
103103
needs: [deploy]
@@ -123,7 +123,7 @@ jobs:
123123
needs: [deploy]
124124
uses: ./.github/workflows/starknet-go-tests.yml
125125
with:
126-
ref: f8f0b717aa5b59c797540c0567f309ae78537e09
126+
ref: 298264d89acbbd6611fcafa09c5b40acd9d35515
127127
rpc_version: v0_8
128128
secrets:
129129
TEST_RPC_URL: ${{ secrets.RPC_URL }}

.github/workflows/starknet-rs-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
uses: actions/checkout@v4
1515
with:
1616
repository: xJonathanLEI/starknet-rs
17-
ref: starknet/v0.12.0
17+
ref: starknet/v0.15.0
1818

1919
- name: Setup Rust
2020
uses: actions-rs/toolchain@v1

rpc/v8/block_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,10 @@ func TestBlockWithTxHashesV013(t *testing.T) {
432432
MaxAmount: new(felt.Felt).SetUint64(tx.ResourceBounds[core.ResourceL2Gas].MaxAmount),
433433
MaxPricePerUnit: tx.ResourceBounds[core.ResourceL2Gas].MaxPricePerUnit,
434434
},
435-
L1DataGas: nil,
435+
L1DataGas: &rpcv8.ResourceBounds{
436+
MaxAmount: &felt.Zero,
437+
MaxPricePerUnit: &felt.Zero,
438+
},
436439
},
437440
Tip: new(felt.Felt).SetUint64(tx.Tip),
438441
PaymasterData: &tx.PaymasterData,

rpc/v8/transaction.go

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -217,29 +217,17 @@ type ResourceBoundsMap struct {
217217
}
218218

219219
func (r *ResourceBoundsMap) MarshalJSON() ([]byte, error) {
220-
type tempResourceBoundsMap struct {
221-
L1Gas *ResourceBounds `json:"l1_gas"`
222-
L2Gas *ResourceBounds `json:"l2_gas"`
223-
}
224-
225-
temp := tempResourceBoundsMap{
226-
L1Gas: r.L1Gas,
227-
L2Gas: r.L2Gas,
228-
}
229-
230-
// Check if L1DataGas is nil, if it is, remove it from the struct/map
220+
// Check if L1DataGas is nil, if it is, provide default values
231221
if r.L1DataGas == nil {
232-
return json.Marshal(temp)
222+
r.L1DataGas = &ResourceBounds{
223+
MaxAmount: &felt.Zero,
224+
MaxPricePerUnit: &felt.Zero,
225+
}
233226
}
234227

235-
// L1Gas and L2Gas should always be present.
236-
return json.Marshal(struct {
237-
*tempResourceBoundsMap
238-
L1DataGas *ResourceBounds `json:"l1_data_gas"`
239-
}{
240-
tempResourceBoundsMap: &temp,
241-
L1DataGas: r.L1DataGas,
242-
})
228+
// Define an alias to avoid recursion
229+
type alias ResourceBoundsMap
230+
return json.Marshal((*alias)(r))
243231
}
244232

245233
// https://github.com/starkware-libs/starknet-specs/blob/a789ccc3432c57777beceaa53a34a7ae2f25fda0/api/starknet_api_openrpc.json#L1252
@@ -399,6 +387,11 @@ func adaptResourceBounds(rb map[core.Resource]core.ResourceBounds) ResourceBound
399387
MaxAmount: new(felt.Felt).SetUint64(rb[core.ResourceL1DataGas].MaxAmount),
400388
MaxPricePerUnit: rb[core.ResourceL1DataGas].MaxPricePerUnit,
401389
}
390+
} else {
391+
l1DataGasResourceBounds = &ResourceBounds{
392+
MaxAmount: &felt.Zero,
393+
MaxPricePerUnit: &felt.Zero,
394+
}
402395
}
403396

404397
// As L1Gas & L2Gas will always be present, we can directly assign them

rpc/v8/transaction_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@ func TestTransactionByHash(t *testing.T) {
372372
"max_amount": "0x60",
373373
"max_price_per_unit": "0x13ac02cbe617"
374374
},
375+
"l1_data_gas": {
376+
"max_amount": "0x0",
377+
"max_price_per_unit": "0x0"
378+
},
375379
"l2_gas": { "max_amount": "0x0", "max_price_per_unit": "0x0" }
376380
},
377381
"tip": "0x0",
@@ -1793,6 +1797,10 @@ func TestResourceBoundsMapMarshalJSON(t *testing.T) {
17931797
"l2_gas": {
17941798
"max_amount": "0xc8",
17951799
"max_price_per_unit": "0x14"
1800+
},
1801+
"l1_data_gas": {
1802+
"max_amount": "0x0",
1803+
"max_price_per_unit": "0x0"
17961804
}
17971805
}`,
17981806
},

0 commit comments

Comments
 (0)