Skip to content

Commit 6223010

Browse files
authored
Merge pull request #2668 from o1-labs/florian/fix-ci-tests
Follow-up fixes for develop-3.0
2 parents f9331a2 + 1ce643b commit 6223010

File tree

15 files changed

+322
-253
lines changed

15 files changed

+322
-253
lines changed

.github/workflows/checks.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ jobs:
319319
needs: [Prepare]
320320
timeout-minutes: 45
321321
runs-on: ubuntu-latest
322-
if: github.event.pull_request.base.ref != 'develop'
322+
if: github.event.pull_request.base.ref == 'develop'
323323
services:
324324
mina-local-network:
325325
image: o1labs/mina-local-network:master-latest-lightnet
@@ -355,7 +355,7 @@ jobs:
355355
needs: [Prepare]
356356
timeout-minutes: 45
357357
runs-on: ubuntu-latest
358-
if: github.event.pull_request.base.ref != 'develop'
358+
if: github.event.pull_request.base.ref == 'main'
359359
services:
360360
mina-local-network:
361361
image: o1labs/mina-local-network:compatible-latest-lightnet
@@ -421,4 +421,39 @@ jobs:
421421
- name: Use shared steps for live testing jobs
422422
uses: ./.github/actions/live-tests-shared
423423
with:
424-
mina-branch-name: develop
424+
mina-branch-name: develop
425+
mesa:
426+
needs: [Prepare]
427+
timeout-minutes: 45
428+
runs-on: ubuntu-latest
429+
if: github.event.pull_request.base.ref == 'develop-3.0'
430+
services:
431+
mina-local-network:
432+
image: o1labs/mina-local-network:mesa-latest-lightnet
433+
env:
434+
NETWORK_TYPE: 'single-node'
435+
PROOF_LEVEL: 'none'
436+
ports:
437+
- 3085:3085
438+
- 5432:5432
439+
- 8080:8080
440+
- 8181:8181
441+
- 8282:8282
442+
volumes:
443+
- /tmp:/root/logs
444+
steps:
445+
- name: Checkout repository
446+
uses: actions/checkout@v4
447+
with:
448+
repository: ${{ inputs.target_repo || github.repository }}
449+
ref: ${{ inputs.target_ref || github.ref }}
450+
- name: build
451+
uses: ./.github/actions/build
452+
with:
453+
repository: ${{ inputs.target_repo || github.repository }}
454+
ref: ${{ inputs.target_ref || github.ref }}
455+
proof_systems_commit: ${{ inputs.proof_systems_commit }}
456+
- name: Use shared steps for live testing jobs
457+
uses: ./.github/actions/live-tests-shared
458+
with:
459+
mina-branch-name: mesa

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ This project adheres to
1818

1919
## [Unreleased](https://github.com/o1-labs/o1js/compare/c2e51a84...HEAD)
2020

21-
### Removed
21+
### Changed
2222

2323
- `Transaction.setFeePerSnarkCost` has been removed, since "snark cost" has been
2424
removed in `mina`, replaced with `MAX_ZKAPP_SEGMENT_PER_TRANSACTION`,
25-
simplifying calculations. Instead, use `setFee`.
25+
simplifying calculations. Instead, use `setFeePerAccountUpdate`.
2626

2727
### Fixed
2828

src/lib/mina/v1/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export namespace TransactionLimits {
1010
}
1111

1212
export namespace ZkappConstants {
13-
export const MAX_ZKAPP_STATE_FIELDS = 8 as const;
13+
export const MAX_ZKAPP_STATE_FIELDS = 32 as const;
1414
export const ACCOUNT_ACTION_STATE_BUFFER_SIZE = 5 as const;
1515
export const ACCOUNT_CREATION_FEE = 1000000000n as const;
1616
}

src/lib/mina/v1/local-blockchain.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ async function LocalBlockchain({ proofsEnabled = true, enforceTransactionLimits
261261
errors,
262262
transaction: txn.transaction,
263263
setFee: txn.setFee,
264+
setFeePerAccountUpdate: txn.setFeePerAccountUpdate,
264265
hash,
265266
toJSON: txn.toJSON,
266267
toPretty: txn.toPretty,

src/lib/mina/v1/mina-instance.ts

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
/**
22
* This module holds the global Mina instance and its interface.
33
*/
4-
import { Field } from '../../provable/wrapped.js';
5-
import { UInt64, UInt32 } from '../../provable/int.js';
4+
import type { NetworkId } from '../../../mina-signer/src/types.js';
65
import { PublicKey } from '../../provable/crypto/signature.js';
6+
import { UInt32, UInt64 } from '../../provable/int.js';
7+
import { Field } from '../../provable/wrapped.js';
78
import type { EventActionFilterOptions } from '././../../mina/v1/graphql.js';
8-
import type { NetworkId } from '../../../mina-signer/src/types.js';
99
import type { Account } from './account.js';
10-
import type { NetworkValue } from './precondition.js';
1110
import type * as Fetch from './fetch.js';
12-
import type { TransactionPromise, PendingTransactionPromise, Transaction } from './transaction.js';
11+
import type { NetworkValue } from './precondition.js';
12+
import type { PendingTransactionPromise, Transaction, TransactionPromise } from './transaction.js';
1313

1414
export {
15-
Mina,
16-
FeePayerSpec,
1715
ActionStates,
16+
FeePayerSpec,
17+
Mina,
1818
NetworkConstants,
19-
defaultNetworkConstants,
2019
activeInstance,
21-
setActiveInstance,
22-
ZkappStateLength,
2320
currentSlot,
21+
defaultNetworkConstants,
22+
fetchActions,
23+
fetchEvents,
2424
getAccount,
25-
hasAccount,
25+
getActions,
2626
getBalance,
27-
getNetworkId,
2827
getNetworkConstants,
28+
getNetworkId,
2929
getNetworkState,
30-
fetchEvents,
31-
fetchActions,
32-
getActions,
3330
getProofsEnabled,
31+
hasAccount,
32+
setActiveInstance,
3433
};
3534

3635
const defaultAccountCreationFee = 1_000_000_000;
@@ -40,8 +39,6 @@ const defaultNetworkConstants: NetworkConstants = {
4039
accountCreationFee: UInt64.from(defaultAccountCreationFee),
4140
};
4241

43-
const ZkappStateLength = 8;
44-
4542
/**
4643
* Allows you to specify information about the fee payer account and the transaction.
4744
*/

src/lib/mina/v1/mina.network.unit-test.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { UInt64, Mina, AccountUpdate, PublicKey, Field, TokenId, PrivateKey } from 'o1js';
2-
import { describe, it, before, beforeEach, afterEach } from 'node:test';
31
import { expect } from 'expect';
2+
import { afterEach, before, beforeEach, describe, it } from 'node:test';
3+
import { AccountUpdate, Field, Mina, PrivateKey, PublicKey, TokenId, UInt64 } from 'o1js';
4+
import { TransactionLimits } from './constants.js';
45

56
const defaultNetwork = Mina.Network({
67
networkId: 'testnet',
@@ -69,7 +70,11 @@ describe('Test default network', () => {
6970

7071
it('More than limit account update', async () => {
7172
let txn = await Mina.transaction(async () => {
72-
for (let index = 0; index < 12; index++) {
73+
for (
74+
let index = 0;
75+
index < TransactionLimits.MAX_ZKAPP_SEGMENT_PER_TRANSACTION + 1;
76+
index++
77+
) {
7378
const accountUpdateBob = AccountUpdate.create(bobAccount, Field.from(index));
7479
accountUpdateBob.account.balance.requireEquals(UInt64.zero);
7580
accountUpdateBob.balance.addInPlace(UInt64.one);
@@ -114,7 +119,11 @@ describe('Test enforced network', () => {
114119

115120
it('More than limit account update', async () => {
116121
let txn = await Mina.transaction(async () => {
117-
for (let index = 0; index < 12; index++) {
122+
for (
123+
let index = 0;
124+
index < TransactionLimits.MAX_ZKAPP_SEGMENT_PER_TRANSACTION + 1;
125+
index++
126+
) {
118127
const accountUpdateBob = AccountUpdate.create(bobAccount, Field.from(index));
119128
accountUpdateBob.account.balance.requireEquals(UInt64.zero);
120129
accountUpdateBob.balance.addInPlace(UInt64.one);
@@ -159,7 +168,11 @@ describe('Test unlimited network', () => {
159168

160169
it('More than limit account update', async () => {
161170
let txn = await Mina.transaction(async () => {
162-
for (let index = 0; index < 12; index++) {
171+
for (
172+
let index = 0;
173+
index < TransactionLimits.MAX_ZKAPP_SEGMENT_PER_TRANSACTION + 1;
174+
index++
175+
) {
163176
const accountUpdateBob = AccountUpdate.create(bobAccount, Field.from(index));
164177
accountUpdateBob.account.balance.requireEquals(UInt64.zero);
165178
accountUpdateBob.balance.addInPlace(UInt64.one);
@@ -252,7 +265,11 @@ describe('Test network with headers', () => {
252265

253266
it('More than limit account update', async () => {
254267
let txn = await Mina.transaction(async () => {
255-
for (let index = 0; index < 12; index++) {
268+
for (
269+
let index = 0;
270+
index < TransactionLimits.MAX_ZKAPP_SEGMENT_PER_TRANSACTION + 1;
271+
index++
272+
) {
256273
const accountUpdateBob = AccountUpdate.create(bobAccount, Field.from(index));
257274
accountUpdateBob.account.balance.requireEquals(UInt64.zero);
258275
accountUpdateBob.balance.addInPlace(UInt64.one);

src/lib/mina/v1/mina.ts

Lines changed: 57 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,90 @@
11
import { Test } from '../../../bindings.js';
2-
import { Field } from '../../provable/wrapped.js';
3-
import { UInt64 } from '../../provable/int.js';
4-
import { PublicKey } from '../../provable/crypto/signature.js';
5-
import { TokenId, Authorization } from './account-update.js';
6-
import * as Fetch from './fetch.js';
7-
import { humanizeErrors, invalidTransactionError } from './errors.js';
82
import { Types } from '../../../bindings/mina-transaction/v1/types.js';
9-
import { Account } from './account.js';
103
import { NetworkId } from '../../../mina-signer/src/types.js';
11-
import { currentTransaction } from './transaction-context.js';
4+
import { PublicKey } from '../../provable/crypto/signature.js';
5+
import { UInt64 } from '../../provable/int.js';
6+
import { Field } from '../../provable/wrapped.js';
7+
import { Authorization, TokenId } from './account-update.js';
8+
import { Account } from './account.js';
9+
import { humanizeErrors, invalidTransactionError } from './errors.js';
10+
import * as Fetch from './fetch.js';
11+
import { type EventActionFilterOptions } from './graphql.js';
12+
import { LocalBlockchain, TestPublicKey } from './local-blockchain.js';
1213
import {
13-
type FeePayerSpec,
14-
type ActionStates,
15-
type NetworkConstants,
16-
activeInstance,
17-
setActiveInstance,
1814
Mina,
19-
defaultNetworkConstants,
15+
activeInstance,
2016
currentSlot,
17+
defaultNetworkConstants,
18+
fetchActions,
19+
fetchEvents,
2120
getAccount,
22-
hasAccount,
21+
getActions,
2322
getBalance,
24-
getNetworkId,
2523
getNetworkConstants,
24+
getNetworkId,
2625
getNetworkState,
27-
fetchEvents,
28-
fetchActions,
29-
getActions,
3026
getProofsEnabled,
27+
hasAccount,
28+
setActiveInstance,
29+
type ActionStates,
30+
type FeePayerSpec,
31+
type NetworkConstants,
3132
} from './mina-instance.js';
32-
import { type EventActionFilterOptions } from './graphql.js';
33+
import { currentTransaction } from './transaction-context.js';
34+
import {
35+
defaultNetworkState,
36+
filterGroups,
37+
reportGetAccountError,
38+
verifyTransactionLimits,
39+
} from './transaction-validation.js';
3340
import {
3441
Transaction,
35-
type PendingTransaction,
36-
type IncludedTransaction,
37-
type RejectedTransaction,
38-
type PendingTransactionStatus,
39-
type PendingTransactionPromise,
42+
createIncludedTransaction,
43+
createRejectedTransaction,
4044
createTransaction,
45+
toPendingTransactionPromise,
4146
toTransactionPromise,
4247
transaction,
43-
createRejectedTransaction,
44-
createIncludedTransaction,
45-
toPendingTransactionPromise,
48+
type IncludedTransaction,
49+
type PendingTransaction,
50+
type PendingTransactionPromise,
51+
type PendingTransactionStatus,
52+
type RejectedTransaction,
4653
} from './transaction.js';
47-
import {
48-
reportGetAccountError,
49-
verifyTransactionLimits,
50-
defaultNetworkState,
51-
filterGroups,
52-
} from './transaction-validation.js';
53-
import { LocalBlockchain, TestPublicKey } from './local-blockchain.js';
5454

5555
export {
56+
ActionStates,
57+
FeePayerSpec,
5658
LocalBlockchain,
5759
Network,
58-
currentTransaction,
59-
Transaction,
60-
type PendingTransaction,
61-
type IncludedTransaction,
62-
type RejectedTransaction,
63-
type PendingTransactionStatus,
64-
type PendingTransactionPromise,
6560
TestPublicKey,
61+
Transaction,
6662
activeInstance,
67-
setActiveInstance,
68-
transaction,
69-
sender,
7063
currentSlot,
64+
currentTransaction,
65+
faucet,
66+
fetchActions,
67+
fetchEvents,
68+
// for internal testing only
69+
filterGroups,
7170
getAccount,
72-
hasAccount,
71+
getActions,
7372
getBalance,
74-
getNetworkId,
7573
getNetworkConstants,
74+
getNetworkId,
7675
getNetworkState,
77-
fetchEvents,
78-
fetchActions,
79-
getActions,
80-
FeePayerSpec,
81-
ActionStates,
82-
faucet,
83-
waitForFunding,
8476
getProofsEnabled,
85-
// for internal testing only
86-
filterGroups,
77+
hasAccount,
78+
sender,
79+
setActiveInstance,
80+
transaction,
81+
waitForFunding,
82+
type IncludedTransaction,
8783
type NetworkConstants,
84+
type PendingTransaction,
85+
type PendingTransactionPromise,
86+
type PendingTransactionStatus,
87+
type RejectedTransaction,
8888
};
8989

9090
// patch active instance so that we can still create basic transactions without giving Mina network details
@@ -254,6 +254,7 @@ function Network(
254254
errors: updatedErrors,
255255
transaction: txn.transaction,
256256
setFee: txn.setFee,
257+
setFeePerAccountUpdate: txn.setFeePerAccountUpdate,
257258
hash,
258259
toJSON: txn.toJSON,
259260
toPretty: txn.toPretty,

0 commit comments

Comments
 (0)