Inside Fuel — November 2022

Welcome to Inside Fuel, our review of technical developments and everything happening on the Fuel Network. Take a moment to catch up on all the latest news.

🆕 Newest Additions To Fuel

Building the fastest modular execution layer would not be possible without an incredible contributor team.  Here are the newest additions to the team this month:

📰 In The News

According to the Rust In Blockchain monthly review, Fuel is one of the most active Rust-based projects this November with 247 merged PRs, 165 closed issues, and 137 open issues.  We are ranked fourth right behind Parity, Sui, and Solana.

🎙️ Podcasts & AMAs

Nick Dodson took part in the Devs Do Something podcast to talk about Sway and the FuelVM.

He also joined Blockchain Capital with John Adler to explain Fuel's vision of scaling Ethereum with the power of the fastest modular execution layer.

Cami Ramos joined the Espacio Crypto podcast (in Spanish) to talk about her experience in growing the Fuel developer community.

🌴 Sway Day

We hosted the second episode of Sway Day, a monthly discussion about all-things Sway. This time, the main topic was Predicates - Why and how you should use them. where we had the chance to have the founders of one of our granted projects, Poolshark, a DEX with a Price-Time-Priority feature, building on Fuel.

Read the TL;DR and listen to the replay here 👇:

Public Appearances

🌉 EthSF

We attended and sponsored the first edition of EthSF in the Bay area, a 3 day-long hackathon during which hackers teamed up to build DApps this November. Read more about the winning projects here.


💻 Technical Updates

Fuelup

What is Fuelup?

Fuelup is the official package manager and multiplexer for Fuel that installs The Fuel Toolchain from the official release channels. It enables you to easily install pre-packaged toolchains, keep them up to date or even create custom toolchains and switch between them.

Binaries are executed through Fuelup as proxies allowing flexibility in the execution of tools.

It simplifies building and maintaining Sway applications with forc and fuel-core for common platforms.

  • Introduction of testnet-specific toolchains: beta-1 and beta-2 toolchains. Installable through fuelup toolchain install beta-2 for example;
  • forc-doc and fuel-indexer are now packaged in a default toolchain;
  • fuelup has completions thanks to an external contributor @0xYYY;
  • fuelup update can be used as a shorthand for fuelup toolchain install latest|nightly;

Sway Libraries

The purpose of this repository is to contain libraries which users can import and use that are not part of the standard library.

These libraries contain helper functions, generalized standards, and other tools valuable to blockchain development.

⚠️ Note: Sway is a language under heavy development therefore the libraries may not be the most ergonomic. Over time they should receive updates/improvements in order to demonstrate how Sway can be used in real use cases.

So far, the following libraries are available to use:

Sway Applications

The purpose of the Sway Applications repository is to demonstrate what can be built with Sway and to promote good development practices.

​That being said, the repository should be deemed as a living project since the applications will be actively maintained, and thus it is likely that none of them will ever reach their final form!​

The repository is young so there isn't anything for anyone to use yet, however, we have lots of applications in development, and lots more planned to be worked on in the near future.

So far, the applications are planned to have a smart contract to demonstrate Sway, tests written in Rust to demonstrate the Rust-SDK, and a user interface to demonstrate the use of the Typescript-SDK.

This part presents the applications that have gone through some level of scrutiny and have been deemed acceptable to be merged into the master branch.​

NOTE
This does not mean that they are complete nor that development has ceased.​
  • New English Auction application. The auction allows sellers to put up assets that they would like to sell based on an initial price and a reserve price. Users bid until the reserve price is met or the time expires;
  • New Name Registry application which allows users to own a human-readable name that can be used to transfer assets. This means that a user does not have to use the hex format of random characters; instead, they can use a memorable word/name to transfer;
  • New Over-The-Counter (OTC) Swap Predicate application demonstrates a proof-of-concept whereby coins to be swapped are locked behind predicates. Anyone can spend these coins, as long as their transaction sends a certain quantity of coins back to a provided address - thereby completing a stateless atomic swap between two parties.
Note: This minimal example could serve as the basis for an entire order book exchange, where orders are circulated off-chain, and settled solely through the funding and spending of predicates. This design would be orders of magnitude more performant than a storage-backed smart contract implementation.
  • New Automated Market Maker (AMM) application. It allows users to swap assets via liquidity pools;

Sway

What is Sway?

Sway is a language for writing smart contracts for the Fuel Virtual Machine (FuelVM), a blazing-fast, blockchain-optimized VM designed for the Fuel blockchain. It is heavily inspired by Rust and aims to bring modern language development and performance to the blockchain ecosystem. Start learning the Sway language today with the Sway Book and the FuelVM Bootcamp.

General Updates

  • New intrinsic functions for operating on raw_ptrs;
  • Bug fix to address dead and incorrectly typed blocks into IR, triggering a verification failure;
  • Disallow assigning to initialized registers in asm blocks;
  • Disallow control flow opcodes in asm blocks;
  • Bug fix for a Cannot infer type error regarding call site span;
  • Bug fixes for errors regarding generic types;
  • Allow returning raw_ptr from scripts;
  • New Checks-Effects-Interactions pattern static analysis feature;
  • Bug fix to control flow graph node uniqueness to prevent erroneous never used errors;
  • New compiler error when using private methods of the library;
  • New array out-of-bounds analysis at compile time;
  • More opcodes to check_invalid_opcodes for predicates;
  • Improve warnings on unnecessary storage annotations;
  • Fix error message for arity mismatch on method calls;
  • Disallows while loops in predicates;
  • New support for mutable arrays;

Standard Library Updates

  • New as_u128 method for to U256;
  • New generic trait From<T>;
  • Updates and rework to the raw_ptr library with breaking changes;
  • Updates and rework to the alloc library with breaking changes;
  • General rework and reformat of the standard library;
  • Small optimizations to U128 and U256;

Tooling Updates

  • Removal of the forc-explore plugin;
  • New workspace building feature;
  • Add [workspace] table to workspace manifest files;
  • Provide a way to detect the type of manifest files and general refactor for workspace builds;
  • Output manifest file parsing errors/warnings for workspace members;
  • Introduction of Sway Unit Tests;
  • New feature to show fn signature and type info, visibility, and mutability on hover requests;

Fuel Core

  • Moved block timestamps to TAI64 in compliance with the specs;
  • GraphQL Subscriptions via SSE for transaction status updates;
  • Upgrade to Cynic 2.2;
  • Prometheus metrics for transaction pool & p2p;
  • Fix for block pagination in GraphQL API;
  • VM fixes for MROO & LB;

SDKs (Fuel-TS & Fuel-RS)

  • Better debugability through parsed readable revert errors;
  • Predicate data encoder;
  • Block time manipulation, useful for testing;
  • Support for script arguments;
  • Transaction fee payment using bridged assets (e.g. ETH);
  • Support for parsed logs in scripts;
  • Contract call dependencies estimation and auto-setup: automatically sets up your contract input set and variable outputs;
  • New support for EVM addresses;
  • New Fuel TypeScript SDK documentation;
  • Rust SDK (Fuel-RS) only: Support for running contract calls in async environments (e.g. passing a contract instance to a thread);

Follow Us

About Us

Fuel is the fastest execution layer for the modular blockchain stack. Powerful and sleek, the technology enables parallel transaction execution, empowering developers with the highest flexible throughput and maximum security required to scale. Developers choose the FuelVM for its superior developer experience and the ability to go beyond the limitations of the EVM.

Become a Contributor