Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation/add more book content #1831

Merged
merged 9 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
7 changes: 6 additions & 1 deletion radix-engine/book/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ shared computing environment in terms of usability, security, performance, and m
Unlike the EVM and other blockchain VMs, Radix Engine:
* Is Object-Oriented and Type-Safe
* Enforces move/ownership semantics
* Has the ability to add system plugins to extend system functionality
* Has the ability to add system plugins to extend/modify system functionality

## Radix Babylon Network

The Radix Engine running on the Radix Babylon network is a specific system configuration of
Radix Engine which makes asset and auth management a native/core feature of the system.
4 changes: 4 additions & 0 deletions radix-engine/book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Outer Object](architecture/application/object/inner_outer_objects.md)
- [Features](architecture/application/object/features.md)
- [Generic Substitutions](architecture/application/object/generic_substitutions.md)
- [Application State](architecture/application/object/application_state.md)
- [Object Modules](architecture/application/object/object_modules.md)
- [Blueprint](architecture/application/blueprint/README.md)
- [Inner and Outer Blueprints](architecture/application/blueprint/inner_outer.md)
Expand All @@ -24,6 +25,7 @@
- [Hooks](architecture/application/blueprint/hooks.md)
- [Types](architecture/application/blueprint/types.md)
- [Blueprint Modules](architecture/application/blueprint/blueprint_modules.md)
- [Package](architecture/application/package/README.md)
- [Type System](architecture/application/type_system/README.md)
- [Actor](architecture/application/actor/README.md)
- [VM Layer](architecture/vm/README.md)
Expand All @@ -32,6 +34,8 @@
- [System Layer](architecture/system/README.md)
- [Object Impl](architecture/system/object_impl.md)
- [Blueprint Impl](architecture/system/blueprint_impl.md)
- [Package Impl](architecture/system/package_impl.md)
- [Type System Impl](architecture/system/type_system_impl.md)
- [Actor Impl](architecture/system/actor_impl.md)
- [System Modules](architecture/system/system_modules.md)
- [Kernel Layer](architecture/kernel/README.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
The system may define additional state to be stored per blueprint known as Blueprint modules. If defined,
every blueprint definition must initialize these modules.

Currently there exists two blueprint modules:
* [Auth Blueprint Module](../../../native/auth/blueprint_module.md)
* [Package Royalties Blueprint Module](../../../native/royalties/package_royalties.md)
> **_NOTE:_** In [Radix Babylon Network](../../../#radix-babylon-network), there currently
> exists two blueprint modules:
> * [Auth Blueprint Module](../../../native/auth/blueprint_module.md)
> * [Package Royalties Blueprint Module](../../../native/royalties/package_royalties.md)
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Collections

> **_NOTE:_** Collections are currently only available for use by native packages.
> **_NOTE:_** In [Radix Babylon Network](../../../#radix-babylon-network),
> Collections are currently only available for use by native packages.

A collection is a set of data which share the same schema. There are currently three types
of collections:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Features

> **_NOTE:_** Features are currently only available for use by native packages.
> **_NOTE:_** In [Radix Babylon Network](../../../#radix-babylon-network), Features
> are currently only available for use by native packages.

Features provide a mechanism to express conditional execution and conditional stored state
(using [Field Conditions](fields.md#field-condition)). The set of features to be used are specified
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Fields

> **_NOTE:_** Use of more than one Field, Field Conditions and Field Transience are currently only available for use by native packages.
> **_NOTE:_** In [Radix Babylon Network](../../../#radix-babylon-network),
> use of more than one Field, Field Conditions and Field Transience are currently only available for use by native packages.

A field is object state which gets loaded at once and maps to a single substate. A schema which
describes what is in the data must be specified for every field.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generics

> **_NOTE:_** Generics are currently only available for use by native packages.
> **_NOTE:_** In [Radix Babylon Network](../../../#radix-babylon-network),
> Generics are currently only available for use by native packages.

Generics to a blueprint requires an object instantiator to specify [generic substitutions](../object/generic_substitutions.md)
during instantiation. Such a generic can then be used in defining function or state schemas.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Hooks

> **_NOTE:_** Hooks are currently only available for use by native packages.
> **_NOTE:_** In [Radix Babylon Network](../../../#radix-babylon-network),
> Hooks are currently only available for use by native packages.

Hooks define logic which get executed when certain system events occur.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Inner and Outer Blueprints

> **_NOTE:_** Inner Blueprints are currently only available for use by native packages.
> **_NOTE:_** In [Radix Babylon Network](../../../#radix-babylon-network),
> Inner Blueprints are currently only available for use by native packages.

A blueprint may be specified as either an Outer or Inner Blueprint. Inner blueprints must specify
an associated outer blueprint defined in the same package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Transience

> **_NOTE:_** Transience is currently only available for use by native packages.
> **_NOTE:_** In [Radix Babylon Network](../../../#radix-babylon-network), Transience is currently only available for use by native packages.

If a blueprint is specified to be transient, all objects of this blueprint cannot be persisted and must
be created/dropped within the lifecycle of a transaction.
10 changes: 6 additions & 4 deletions radix-engine/book/src/architecture/application/object/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ parent in the tree hierarchy. Each root object is assigned a *global address*.
![](object_model.drawio.svg)

Each object has:
* A [BlueprintId](blueprint_id.md) (type)
* An optional [Outer Object](inner_outer_objects.md)
* A list of [Features](features.md)
* A list of [Generic Substitutions](generic_substitutions.md)
* Static Type Information which includes:
* A [BlueprintId](blueprint_id.md)
* An optional [Outer Object](inner_outer_objects.md)
* A list of [Features](features.md)
* A list of [Generic Substitutions](generic_substitutions.md)
* Application State
* A set of [Object Modules](object_modules.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Application State

Each object may have a set of [fields](../blueprint/fields.md) and
[collections](../blueprint/collections.md) which represent that object's state.
When created or updated, these fields and collections must conform to the schema specified
by the object's [blueprint](blueprint_id.md).
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Blueprint Id

Every object is associated with a blueprint id which consists of
`<package_address> + <blueprint_name>`. A blueprint id uniquely identifies the
[blueprint](../blueprint/README.md) of an object.
`<package_address> + <blueprint_name>`.

A blueprint id uniquely identifies the [blueprint](../blueprint) of an object.
The blueprint of an object specifies both the structure and the logic of the object.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Features

An object's features describes is a subset of the total [features](../blueprint/features.md) defined
in the object's blueprint. Having a feature enabled/disabled can modify both behavior and state stored
for the object.
An object's features describes a subset of the total [features](../blueprint/features.md) defined
in the object's blueprint. Having a feature enabled/disabled can modify both behavior and
state stored for the object.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ the state of the object module.

![](object_modules.drawio.svg)

Currently, there exists three object modules:
* [RoleAssignment](../../../native/auth/role_assignment.md) (Required)
* [Metadata](../../../native/metadata/object_module.md) (Required)
* [Component Royalties](../../../native/royalties/component_royalties.md) (Optional)
> **_NOTE:_** In [Radix Babylon Network](../../../#radix-babylon-network), there currently
> exists three object modules:
> * [RoleAssignment](../../../native/auth/role_assignment.md) (Required)
> * [Metadata](../../../native/metadata/object_module.md) (Required)
> * [Component Royalties](../../../native/royalties/component_royalties.md) (Optional)

20 changes: 20 additions & 0 deletions radix-engine/book/src/architecture/application/package/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Package

A package is a special native object which contains 0 or more blueprint definitions. Because it is an
object, packages inherit object-like qualities such as the ability to have object modules
(like metadata).

## Package Blueprint and Package Package

This type of relationship creates the following circular definition:

`An Object is of some Blueprint type.`

`A Blueprint is part of a Package.`

`A Package is an Object.`

This circular definition creates the notion of the Package Blueprint and the
Package Package (similar to Class.class in java). A Package Blueprint is the
blueprint type of a Package object and Package Package is the package which
contains the Package Blueprint.
talekhinezh marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ the Blueprint. This includes:
* Function Input/Output
* Events

The Type Checking System supports generics.
The Schema Checking System supports generics.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly prefer to the previous word. Schema checking gives me the impression that we're checking the validity of schema (which is part of SBOR schema terminology)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed


![](type_checking_arch.drawio.svg)
![](type_checking_arch.drawio.svg)
2 changes: 1 addition & 1 deletion radix-engine/book/src/architecture/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ layer above must implement.
| [VM](vm/README.md) | Executes Application Code |
| [System](system/README.md) | Defines Actor abstraction (Memory Protection)<br>Defines Package, Blueprint, Object abstractions<br>Defines System Standards such as Authorization and Versioning |
| [Kernel](kernel/README.md) | Defines Node, Partition, Substate abstractions<br>Maintains Call Frame Stack<br>Maintains Ownership/Reference invariants |
| Database | Defines PartitionKey, SortKey abstractions |
| [Database](database/README.md) | Defines PartitionKey, SortKey abstractions |

2 changes: 1 addition & 1 deletion radix-engine/book/src/architecture/system/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# System Layer

The System Layer is responsible for:
* Defining the [Object](object_impl.md), [Blueprint](blueprint_impl.md), and Package abstraction
* Defining the [Object](object_impl.md), [Blueprint](blueprint_impl.md), [Type System](type_system_impl.md), and [Package](package_impl.md) abstraction
* Defining [Actor](actor_impl.md) abstraction and memory protection
* Maintaining a set of [System Modules](system_modules.md), or pluggable software, which extends the
functionality of the system.
Expand Down
5 changes: 3 additions & 2 deletions radix-engine/book/src/architecture/system/blueprint_impl.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## State to Partition Mapping

The mapping from Fields and Collection indices to Partition Number is managed by the System Layer
and done at a per blueprint basis.
The mapping from the Fields and Collection indices to Partition Number is managed by the System Layer
and done at a per blueprint basis. This includes the Fields and Collection indices of the object modules
for and object.

![](bp_partition_mapping.drawio.svg)
Loading
Loading