Skip to content

Dimension v0.3.1

Latest

Choose a tag to compare

@Femtech-web Femtech-web released this 20 Nov 17:56
· 4 commits to main since this release

A fix to the seals. Fe 26.6 does not check a private trait's visibility where
the trait is implemented (argotorg/fe#2036),
so on 0.3.0 code outside Dimension could implement the private Sealed trait
and add a third flow or rounding direction. This release closes that without
relying on the compiler fix.

Install

Requires Fe 26.6.0 or 26.7.0. In your ingot's fe.toml:

[dependencies.dimension]
source = "https://github.com/Femtech-web/Dimension"
rev = "5a1aafe80e2f9034242fb6f5ada9b2495685d2ac"   # v0.3.1
name = "dimension"
version = "0.3.1"

Or start a project with the command line, now installable:

pipx install "git+https://github.com/Femtech-web/Dimension#subdirectory=cli"
dimension new my-protocol

What is fixed

Each seal (Rounding, and the one Flow, Stage and Valuation share) now
has a method that takes Key, a struct private to its module. Fe checks a
struct's visibility, so an implementation written elsewhere fails whether it
names the key or leaves the method out:

impl dimension::flow::Sealed for Sideways {
    fn key(_ k: dimension::flow::Key) {}
                                ^^^ `Key` is not visible

Code that never implemented the seal, which was never supported, has nothing
to change. The API is unchanged, and every compiled contract (the pools, the
oracle, the vault) is byte-identical to 0.3.0's.

How it is proven

Check Result
Two new compile-fail cases: a flow and a rounding direction added by implementing the seal from outside both rejected with 2-0003; their corrected twins pass
A new mutant that makes the seal's key public caught by the compile-fail suite
Every contract built from the library, before and after 16 bytecode files byte-identical

Also since 0.3.0, outside the library

  • Live on Base Sepolia: the pools, the cbETH oracle and the vault, deployed
    and attacked on chain; make live reads every outcome back.
  • In the browser: the same Balancer kernels compiled to WebAssembly,
    checked step by step against the EVM (make wasm).
  • Docker: docker run --rm ghcr.io/femtech-web/dimension runs every
    offline check.
  • The command line installs with pipx, outside a clone.