Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5545d7c
Add blob tx support
Dentosal Jun 26, 2024
9e4c221
Add changelog entry
Dentosal Jun 26, 2024
97592f6
Merge branch 'master' into dento/blob-tx
Dentosal Jun 26, 2024
e7d724e
FIx changelog after merge
Dentosal Jun 26, 2024
bd4aae7
Merge branch 'master' into dento/blob-tx
Dentosal Jul 11, 2024
c3cba47
fmt
Dentosal Jul 11, 2024
d8ea550
Update benches to use the LDCv1
Dentosal Jul 26, 2024
d137b4b
Update crates/fuel-core/src/schema/dap.rs
Dentosal Jul 29, 2024
b9c610e
Merge branch 'master' into dento/blob-tx
Dentosal Jul 29, 2024
266a474
Update to fuel-vm 0.56.0 proper
Dentosal Jul 29, 2024
968781d
Add regenesis support for blobs
Dentosal Jul 29, 2024
bae0a87
Fix issues with exporting tables
Dentosal Jul 29, 2024
2260d80
Update changelog
Dentosal Jul 29, 2024
f30853b
Add tests for blob uploading and access
Dentosal Jul 29, 2024
ebfc6a9
Cleanup
Dentosal Jul 29, 2024
b07688f
Move an import to comply with feature flags
Dentosal Jul 29, 2024
7b3d3ad
Fix link to BlobData table
Dentosal Jul 29, 2024
0fe1e1f
Fix JSON snapshot merging
Dentosal Jul 29, 2024
71b7e88
Fix backwards compatibility for chainconfig fields
Dentosal Jul 29, 2024
819d77e
Update GraphQL schema with new gas costs
Dentosal Jul 29, 2024
550cee7
Gas price API fix
Dentosal Jul 29, 2024
6c66c45
Clippy
Dentosal Jul 29, 2024
2f4393a
Update local configs to match
Dentosal Jul 29, 2024
de85def
More "fun" with gas and snapshots
Dentosal Jul 29, 2024
68cb46f
Typo removal
Dentosal Jul 29, 2024
a0bdfcc
Comply better with G/W/T ordering
Dentosal Jul 30, 2024
1c6fb2d
Remove unused import
Dentosal Jul 30, 2024
b4fb62e
Detect and show errors in produce_block_with_tx
Dentosal Jul 30, 2024
15cbafb
Update state transition bytecode
Dentosal Jul 30, 2024
baae7f5
Address some of the PR feedback
Dentosal Jul 30, 2024
ebe4c21
ed19_dependent_cost
Dentosal Jul 30, 2024
9555ef9
add blobs to roundtrip json/parquet encoding/decoding tests
segfault-magnet Aug 1, 2024
eb454c2
Merge branch 'master' into dento/blob-tx
Voxelot Aug 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]

### Added
- [#1988](https://github.com/FuelLabs/fuel-core/pull/1988): Updated `fuel-vm` to `0.55.0` ([release notes](https://github.com/FuelLabs/fuel-vm/releases/tag/v0.55.0)). Adds Blob transaction support.
- [1983](https://github.com/FuelLabs/fuel-core/pull/1983): Add adapters for gas price service for accessing database values

## [Version 0.31.0]
Expand Down
24 changes: 8 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,6 @@ itertools = { version = "0.12", default-features = false }
insta = "1.8"
tempfile = "3.4"
tikv-jemallocator = "0.5"

[patch.crates-io]
fuel-vm-private = { git = "https://github.com/FuelLabs/fuel-vm", branch="dento/blob-tx", package = "fuel-vm" }
4 changes: 4 additions & 0 deletions crates/client/assets/schema.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ input BalanceFilterInput {
owner: Address!
}

scalar BlobId

type Block {
version: BlockVersion!
id: BlockId!
Expand Down Expand Up @@ -1143,6 +1145,7 @@ type Transaction {
isMint: Boolean!
isUpgrade: Boolean!
isUpload: Boolean!
isBlob: Boolean!
inputs: [Input!]
outputs: [Output!]!
outputContract: ContractOutput
Expand All @@ -1152,6 +1155,7 @@ type Transaction {
script: HexString
scriptData: HexString
bytecodeWitnessIndex: U16
blobId: BlobId
salt: Salt
storageSlots: [HexString!]
bytecodeRoot: Bytes32
Expand Down
1 change: 1 addition & 0 deletions crates/client/src/client/schema/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ fuel_type_scalar!(Bytes32, Bytes32);
fuel_type_scalar!(Address, Address);
fuel_type_scalar!(BlockId, Bytes32);
fuel_type_scalar!(AssetId, AssetId);
fuel_type_scalar!(BlobId, BlobId);
fuel_type_scalar!(ContractId, ContractId);
fuel_type_scalar!(Salt, Salt);
fuel_type_scalar!(TransactionId, Bytes32);
Expand Down
49 changes: 48 additions & 1 deletion crates/client/src/client/schema/tx/transparent_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::client::schema::{
},
Address,
AssetId,
BlobId,
Bytes32,
ConnectionArgs,
ContractId,
Expand All @@ -26,12 +27,13 @@ use core::convert::{
TryInto,
};
use fuel_core_types::{
fuel_tx,
fuel_tx::{
self,
field::ReceiptsRoot,
input,
output,
policies::PolicyType,
BlobBody,
StorageSlot,
UploadBody,
},
Expand Down Expand Up @@ -127,6 +129,11 @@ pub struct Transaction {
/// The result of a `is_upload()` helper function is stored here.
/// It is not an original field of the `Transaction`.
pub is_upload: bool,
/// It is `true` for `Transaction::Blob`.
///
/// The result of a `is_blob()` helper function is stored here.
/// It is not an original field of the `Transaction`.
pub is_blob: bool,
/// The field of the `Transaction` type.
pub outputs: Vec<Output>,
/// The field of the `Transaction::Mint`.
Expand Down Expand Up @@ -165,6 +172,8 @@ pub struct Transaction {
pub proof_set: Option<Vec<Bytes32>>,
/// The field of the `Transaction::Upgrade`.
pub upgrade_purpose: Option<UpgradePurpose>,
/// The field of the `Transaction::Blob`.
pub blob_id: Option<BlobId>,
}

impl TryFrom<Transaction> for fuel_tx::Transaction {
Expand Down Expand Up @@ -387,6 +396,43 @@ impl TryFrom<Transaction> for fuel_tx::Transaction {
.collect(),
);
tx.into()
} else if tx.is_blob {
let tx = fuel_tx::Transaction::blob(
BlobBody {
id: tx
.blob_id
.ok_or_else(|| {
ConversionError::MissingField("blob_id".to_string())
})?
.into(),
witness_index: tx
.bytecode_witness_index
.ok_or_else(|| {
ConversionError::MissingField("witness_index".to_string())
})?
.into(),
},
tx.policies
.ok_or_else(|| ConversionError::MissingField("policies".to_string()))?
.into(),
tx.inputs
.ok_or_else(|| ConversionError::MissingField("inputs".to_string()))?
.into_iter()
.map(TryInto::try_into)
.collect::<Result<Vec<fuel_tx::Input>, ConversionError>>()?,
tx.outputs
.into_iter()
.map(TryInto::try_into)
.collect::<Result<Vec<fuel_tx::Output>, ConversionError>>()?,
tx.witnesses
.ok_or_else(|| {
ConversionError::MissingField("witnesses".to_string())
})?
.into_iter()
.map(|w| w.0 .0.into())
.collect(),
);
tx.into()
} else {
return Err(ConversionError::UnknownVariant("Transaction"));
};
Expand All @@ -401,6 +447,7 @@ impl TryFrom<Transaction> for fuel_tx::Transaction {
fuel_tx::Transaction::Mint(_) => {}
fuel_tx::Transaction::Upgrade(_) => {}
fuel_tx::Transaction::Upload(_) => {}
fuel_tx::Transaction::Blob(_) => {}
};

Ok(tx)
Expand Down
7 changes: 6 additions & 1 deletion crates/fuel-core/src/graphql_api/worker_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ where
inputs = tx.inputs().as_slice();
outputs = tx.outputs().as_slice();
}
Transaction::Blob(tx) => {
inputs = tx.inputs().as_slice();
outputs = tx.outputs().as_slice();
}
}
persist_owners_index(
block_height,
Expand Down Expand Up @@ -373,7 +377,8 @@ where
Transaction::Script(_)
| Transaction::Mint(_)
| Transaction::Upgrade(_)
| Transaction::Upload(_) => {
| Transaction::Upload(_)
| Transaction::Blob(_) => {
// Do nothing
}
}
Expand Down
7 changes: 4 additions & 3 deletions crates/fuel-core/src/schema/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,10 @@ impl FeeParameters {
impl GasCosts {
async fn version(&self) -> GasCostsVersion {
match self.0.deref() {
GasCostsValues::V1(_) | GasCostsValues::V2(_) | GasCostsValues::V3(_) => {
GasCostsVersion::V1
}
GasCostsValues::V1(_)
| GasCostsValues::V2(_)
| GasCostsValues::V3(_)
| GasCostsValues::V4(_) => GasCostsVersion::V1,
}
}

Expand Down
3 changes: 3 additions & 0 deletions crates/fuel-core/src/schema/dap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ impl DapMutation {
CheckedTransaction::Upload(_) => {
Err(async_graphql::Error::new("`Upload` is not supported"))
}
CheckedTransaction::Blob(_) => {
Err(async_graphql::Error::new("`Upload` is not supported"))
}
}
}

Expand Down
1 change: 1 addition & 0 deletions crates/fuel-core/src/schema/scalars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ fuel_type_scalar!("Bytes32", Bytes32, Bytes32, 32);
fuel_type_scalar!("Address", Address, Address, 32);
fuel_type_scalar!("BlockId", BlockId, Bytes32, 32);
fuel_type_scalar!("AssetId", AssetId, AssetId, 32);
fuel_type_scalar!("BlobId", BlobId, BlobId, 32);
fuel_type_scalar!("ContractId", ContractId, ContractId, 32);
fuel_type_scalar!("Salt", Salt, Salt, 32);
fuel_type_scalar!("TransactionId", TransactionId, Bytes32, 32);
Expand Down
Loading