Skip to content

Commit

Permalink
chore!: upgrade fuel-core to 0.26.0 (#2217)
Browse files Browse the repository at this point in the history
  • Loading branch information
Torres-ssf committed May 4, 2024
1 parent 86543ed commit 2990edb
Show file tree
Hide file tree
Showing 49 changed files with 1,132 additions and 221 deletions.
11 changes: 11 additions & 0 deletions .changeset/cool-deers-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@fuel-ts/transactions": minor
"@fuel-ts/fuel-core": minor
"@fuel-ts/versions": minor
"@fuel-ts/account": minor
"@fuel-ts/program": minor
"@fuel-ts/script": minor
"@fuel-ts/utils": minor
---

chore!: upgrade `fuel-core` to `0.26.0`
3 changes: 2 additions & 1 deletion .fuel-core/configs/chainConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"max_outputs": 255,
"max_witnesses": 255,
"max_gas_per_tx": 30000000,
"max_size": 112640
"max_size": 112640,
"max_bytecode_subsections": 256
}
},
"predicate_params": {
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion apps/demo-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"pretest": "pnpm original:build"
},
"dependencies": {
"@fuels/vm-asm": "0.42.1",
"@fuels/vm-asm": "0.49.0",
"@types/node": "18.15.3",
"@types/react-dom": "18.2.4",
"@types/react": "18.2.9",
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-react-cra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.29",
"private": true,
"dependencies": {
"@fuels/vm-asm": "0.42.1",
"@fuels/vm-asm": "0.49.0",
"@testing-library/react": "^13.4.0",
"@types/node": "^16.18.34",
"@types/react": "^18.2.9",
Expand Down
2 changes: 1 addition & 1 deletion apps/demo-react-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"pretest": "pnpm original:build"
},
"dependencies": {
"@fuels/vm-asm": "0.42.1",
"@fuels/vm-asm": "0.49.0",
"fuels": "workspace:*",
"react-dom": "^18.2.0",
"react": "^18.2.0"
Expand Down
22 changes: 13 additions & 9 deletions packages/account/codegen.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,23 @@
],
"config": {
"scalars": {
"DateTime": "string",
"HexString": "string",
"Bytes32": "string",
"UtxoId": "string",
"U64": "string",
"Address": "string",
"BlockId": "string",
"TransactionId": "string",
"AssetId": "string",
"BlockId": "string",
"Bytes32": "string",
"ContractId": "string",
"Salt": "string",
"HexString": "string",
"Nonce": "string",
"Tai64Timestamp": "string"
"RelayedTransactionId": "string",
"Salt": "string",
"Signature": "string",
"Tai64Timestamp": "string",
"TransactionId": "string",
"TxPointer": "string",
"U16": "string",
"U32": "string",
"U64": "string",
"UtxoId": "string"
},
"useTypeImports": true,
"nonOptionalTypename": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@fuel-ts/transactions": "workspace:*",
"@fuel-ts/utils": "workspace:*",
"@fuel-ts/versions": "workspace:*",
"@fuels/vm-asm": "0.42.1",
"@fuels/vm-asm": "0.49.0",
"@noble/curves": "^1.3.0",
"ethers": "^6.7.1",
"events": "^3.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/account/src/predicate/predicate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class Predicate<TInputData extends InputValue[]> extends Account {
const paddedCode = new ByteArrayCoder(this.bytes.length).encode(this.bytes);

const VM_TX_MEMORY = calculateVmTxMemory({
maxInputs: this.provider.getChain().consensusParameters.maxInputs.toNumber(),
maxInputs: this.provider.getChain().consensusParameters.txParameters.maxInputs.toNumber(),
});
const OFFSET =
VM_TX_MEMORY +
Expand Down
52 changes: 49 additions & 3 deletions packages/account/src/providers/fuel-core-schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ type ConsensusParameters {
privilegedAddress: Address!
}

type ConsensusParametersPurpose {
witnessIndex: U16!
checksum: Bytes32!
}

enum ConsensusParametersVersion {
V1
}
Expand Down Expand Up @@ -285,11 +290,15 @@ type DryRunFailureStatus {
programState: ProgramState
reason: String!
receipts: [Receipt!]!
totalGas: U64!
totalFee: U64!
}

type DryRunSuccessStatus {
programState: ProgramState
receipts: [Receipt!]!
totalGas: U64!
totalFee: U64!
}

type DryRunTransactionExecutionStatus {
Expand Down Expand Up @@ -323,6 +332,8 @@ type FailureStatus {
reason: String!
programState: ProgramState
receipts: [Receipt!]!
totalGas: U64!
totalFee: U64!
}

type FeeParameters {
Expand Down Expand Up @@ -474,6 +485,11 @@ type Genesis {
The Binary Merkle Tree root of all genesis messages.
"""
messagesRoot: Bytes32!

"""
The Binary Merkle Tree root of all processed transaction ids.
"""
transactionsRoot: Bytes32!
}

type Header {
Expand All @@ -500,12 +516,12 @@ type Header {
"""
Number of transactions in this block.
"""
transactionsCount: U64!
transactionsCount: U16!

"""
Number of message receipts in this block.
"""
messageReceiptCount: U64!
messageReceiptCount: U32!

"""
Merkle root of transactions.
Expand Down Expand Up @@ -1023,7 +1039,12 @@ type Query {
commitBlockHeight: U32
): MessageProof
messageStatus(nonce: Nonce!): MessageStatus!
message(nonce: Nonce!): Message
relayedTransactionStatus(
"""
The id of the relayed tx
"""
id: RelayedTransactionId!
): RelayedTransactionStatus
}

type Receipt {
Expand Down Expand Up @@ -1077,6 +1098,15 @@ enum ReceiptType {
BURN
}

type RelayedTransactionFailed {
blockHeight: U32!
failure: String!
}

scalar RelayedTransactionId

union RelayedTransactionStatus = RelayedTransactionFailed

enum ReturnType {
RETURN
RETURN_DATA
Expand Down Expand Up @@ -1136,6 +1166,10 @@ type SqueezedOutStatus {
reason: String!
}

type StateTransitionPurpose {
root: Bytes32!
}

type SubmittedStatus {
time: Tai64Timestamp!
}
Expand Down Expand Up @@ -1174,6 +1208,8 @@ type SuccessStatus {
time: Tai64Timestamp!
programState: ProgramState
receipts: [Receipt!]!
totalGas: U64!
totalFee: U64!
}

scalar Tai64Timestamp
Expand All @@ -1193,6 +1229,8 @@ type Transaction {
isScript: Boolean!
isCreate: Boolean!
isMint: Boolean!
isUpgrade: Boolean!
isUpload: Boolean!
inputs: [Input!]
outputs: [Output!]!
outputContract: ContractOutput
Expand All @@ -1204,6 +1242,11 @@ type Transaction {
bytecodeWitnessIndex: U16
salt: Salt
storageSlots: [HexString!]
bytecodeRoot: Bytes32
subsectionIndex: U16
subsectionsNumber: U16
proofSet: [Bytes32!]
upgradePurpose: UpgradePurpose

"""
Return the transaction bytes using canonical encoding
Expand Down Expand Up @@ -1258,6 +1301,7 @@ type TxParameters {
maxWitnesses: U32!
maxGasPerTx: U64!
maxSize: U64!
maxBytecodeSubsections: U16!
}

enum TxParametersVersion {
Expand All @@ -1272,6 +1316,8 @@ scalar U32

scalar U64

union UpgradePurpose = ConsensusParametersPurpose | StateTransitionPurpose

scalar UtxoId

type VariableOutput {
Expand Down
4 changes: 2 additions & 2 deletions packages/account/src/providers/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export type MerkleProof = {
export type BlockHeader = {
id: string;
daHeight: BN;
transactionsCount: BN;
transactionsCount: number;
transactionsRoot: string;
height: BN;
prevRoot: string;
Expand All @@ -48,7 +48,7 @@ export type BlockHeader = {
eventInboxRoot: string;
consensusParametersVersion: number;
stateTransitionBytecodeVersion: number;
messageReceiptCount: BN;
messageReceiptCount: number;
};

/**
Expand Down
27 changes: 24 additions & 3 deletions packages/account/src/providers/operations.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ fragment transactionStatusFragment on TransactionStatus {
id
}
time
receipts {
...receiptFragment
}
programState {
returnType
data
}
receipts {
...receiptFragment
}
totalGas
totalFee
}
... on FailureStatus {
block {
id
}
totalGas
totalFee
time
reason
receipts {
Expand Down Expand Up @@ -72,6 +73,8 @@ fragment transactionEstimatePredicatesFragment on Transaction {
}

fragment dryRunFailureStatusFragment on DryRunFailureStatus {
totalGas
totalFee
reason
programState {
returnType
Expand All @@ -80,6 +83,8 @@ fragment dryRunFailureStatusFragment on DryRunFailureStatus {
}

fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
totalGas
totalFee
programState {
returnType
data
Expand Down Expand Up @@ -235,6 +240,7 @@ fragment TxParametersFragment on TxParameters {
maxWitnesses
maxGasPerTx
maxSize
maxBytecodeSubsections
}

fragment PredicateParametersFragment on PredicateParameters {
Expand Down Expand Up @@ -494,6 +500,13 @@ fragment nodeInfoFragment on NodeInfo {
nodeVersion
}

fragment relayedTransactionStatusFragment on RelayedTransactionStatus {
... on RelayedTransactionFailed {
blockHeight
failure
}
}

query getNodeInfo {
nodeInfo {
...nodeInfoFragment
Expand Down Expand Up @@ -729,6 +742,14 @@ query getMessageStatus($nonce: Nonce!) {
}
}

query getRelayedTransactionStatus(
$relayedTransactionId: RelayedTransactionId!
) {
relayedTransactionStatus(id: $relayedTransactionId) {
...relayedTransactionStatusFragment
}
}

mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
...dryRunTransactionExecutionStatusFragment
Expand Down

0 comments on commit 2990edb

Please sign in to comment.