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

Add info about event_inbox_root on the header #571

Merged
merged 15 commits into from
Apr 23, 2024

Conversation

MitchTurner
Copy link
Member

@MitchTurner MitchTurner changed the title Add info about inbox_event_root on the header Add info about event_inbox_root on the header Apr 10, 2024
@MitchTurner MitchTurner marked this pull request as draft April 10, 2024 19:08
@MitchTurner MitchTurner self-assigned this Apr 15, 2024
@MitchTurner MitchTurner requested a review from a team April 15, 2024 20:16
@MitchTurner MitchTurner marked this pull request as ready for review April 15, 2024 20:38
| `message_receipt_count` | `uint64` | Number of [output message](../abi/receipts.md#messageout-receipt)s in this block. |
| `txRoot` | `byte[32]` | [Merkle root](./cryptographic-primitives.md#binary-merkle-tree) of [transaction](../tx-format/transaction.md)s in this block. |
| `message_outbox_root` | `byte[32]` | [Merkle root](./cryptographic-primitives.md#binary-merkle-tree) of [output message](../abi/receipts.md#messageout-receipt)s [`messageId`](../identifiers/utxo-id.md#message-id) in this block. |
| `event_inbox_root` | `byte[32]` | [Merkle root](./cryptographic-primitives.md#binary-merkle-tree) of all events imported from L1 in this block. The order of the events added to the Merkle tree is the L1 block order, and the index of each event within each block |
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be nice to put a link to relayer section to describe what events are. And it would be nice to describe over what Merkle tree is created(like hash of the event or hash of all fields).


The Fuel blockchain can emit messages that will be processed by the smart contract on the L1 blockchain. The smart
contract on the L1 can also emit events that will be processed by the Fuel blockchain.
This is used to move assets between the two blockchains.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This is used to move assets between the two blockchains.
This is used to move any data between L1 <> L2.

src/protocol/relayer.md Outdated Show resolved Hide resolved
src/protocol/relayer.md Outdated Show resolved Hide resolved
src/protocol/relayer.md Outdated Show resolved Hide resolved
src/protocol/relayer.md Outdated Show resolved Hide resolved
|--------------------------|-----------|---------------------------------------------------------------------------------------|
| `nonce` | `bytes[32]` | Unique identifier of the transaction on L1 |
| `max_gas` | `uint64` | The maximum amount of gas executing this transaction will cost on the Fuel Blockchain |
| `serialized_transaction` | `byte[]` | The serialized transaction bytes |
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe put a link to canonical serialisation and to supported transaction types

Copy link
Member Author

@MitchTurner MitchTurner Apr 17, 2024

Choose a reason for hiding this comment

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

I don't see any definitions in our specs about canonical serialization, just references to it. So I'll just reference it for now.

src/protocol/relayer.md Outdated Show resolved Hide resolved
src/protocol/relayer.md Outdated Show resolved Hide resolved
MitchTurner and others added 6 commits April 17, 2024 10:46
Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
@MitchTurner MitchTurner requested a review from xgreenx April 17, 2024 18:46
|--------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `nonce` | `bytes[32]` | Unique identifier of the transaction assigned by the L1 contract |
| `max_gas` | `uint64` | The maximum amount of gas allowed to use on Fuel Blockchain |
| `serialized_transaction` | `byte[]` | The serialized transaction bytes following canonical serialization. Only supports `Create` and `Script` [transaction](../tx-format/transaction.md), not `Mint` |
Copy link
Contributor

Choose a reason for hiding this comment

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

Now we have two more types of transactions=)

Copy link
Contributor

@xgreenx xgreenx left a comment

Choose a reason for hiding this comment

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

It looks good to me, but it would be nice to get some approve from the person less familiar with the feature to get a fresh look=) Maybe @Dentosal


These are transactions that are submitted on the L1 that must be executed on the Fuel blockchain.
This "Forced Transaction Inclusion" is a security feature that allows participants of the Fuel Blockchain to access
their funds in the (unlikely) event that the Fuel blockchain block production is compromised or malicious.
Copy link
Member

Choose a reason for hiding this comment

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

Could mention censorship-resistancy here, as that's the primary technical form of compromise this protects against


## Fuel Message Outbox

The message outbox is the set of messages sent to the L1 blockchain from the Fuel blockchain.
Copy link
Member

Choose a reason for hiding this comment

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

I'd still like to see more technical description on how the message sending works. I.e. how can I verify that a message was actually sent on L1?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have intentionally not included a lot of detail on the "outbox" section, since this issue is specifically for the "inbox" stuff. There just wasn't any info on any of this stuff in the specs, so I wanted to set aside some space for the "outbox" stuff as well.

I'll create an issue for this: #575

@MitchTurner MitchTurner requested review from Dentosal and xgreenx April 22, 2024 18:23
@MitchTurner MitchTurner merged commit e09a271 into master Apr 23, 2024
6 checks passed
@MitchTurner MitchTurner deleted the l1-event-ordering-and-merkle-proof branch April 23, 2024 17:14
The event inbox is the set of events received from the L1 blockchain by the Fuel blockchain.

The block producer will receive the list of events from the L1 by some relayer, and then include both the count and the
merkle root of the events in the block header.
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't look like we actually put the event count into the header

Copy link
Member

Choose a reason for hiding this comment

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

This count is implicitly derived from the da height and reconciling that with L1 data

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh. Whoops. We only include it for the outbox.

Voxelot pushed a commit that referenced this pull request Apr 26, 2024
Something was missed in this
[PR](#571) and this fixes it.

### Before requesting review
- [x] I have reviewed the code myself

### After merging, notify other teams

- [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/)
- [ ] [Sway compiler](https://github.com/FuelLabs/sway/)
- [ ] [Platform
documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+)
(for out-of-organization contributors, the person merging the PR will do
this)
- [ ] Someone else?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants