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

v0.11 fixes #285

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

v0.11 fixes #285

wants to merge 8 commits into from

Conversation

zoedberg
Copy link
Contributor

This PR is part of a v0.11 fixes epic, see RGB-WG/rgb-tests#30 for an overview.

@zoedberg
Copy link
Contributor Author

CI fails because this needs other repos in the epic to be patched

Copy link
Member

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

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

Reviewed first two commits, up to cf40921

Concept ACK.

Approach in cf40921 is NACK: a contract must commit to the Layer1. Yes, it shouldn't commit to AltLayers, but it must now commit to a specific layer1.

Before, all contracts were multi-layer; and thus supported bitcoin + maybe some other layers.

Now contracts are single-layer, and there is no way how to find whether it is bitcoin or liquid or something. It must be specified as a strong commitment in the contract Genesis, like we have that in v0.12,

@zoedberg
Copy link
Contributor Author

Approach in cf40921 is NACK: a contract must commit to the Layer1. Yes, it shouldn't commit to AltLayers, but it must now commit to a specific layer1.

I thought that since the genesis always has some assignments it would be enough to check that those assignments are all defined on the same layer 1. But I'll add a layer 1 to the genesis to make this more explicit.

@zoedberg
Copy link
Contributor Author

@dr-orlovsky added layer1 to genesis, here and in related PRs

@dr-orlovsky
Copy link
Member

dr-orlovsky commented Jan 16, 2025

I thought that since the genesis always has some assignments it would be enough to check that those assignments are all defined on the same layer 1

Consensus doesn't require genesis to have at least one assignment. For instance, in RGB30, genesis doesn't have any.

Copy link
Member

@dr-orlovsky dr-orlovsky left a comment

Choose a reason for hiding this comment

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

Three other general notes:

  1. I do not see how 3030a3f handles reorgs; a new enum field is not used at all
  2. I believe we do not need bundles to commit to the close method, that is excessive
  3. The support of multi-blockchain contracts is still there. Overall, the type XChain needs to be removed - and you will see how many remnants are still haven't dealt with.

));
continue;
}
if self.close_method != bundle.close_method {
Copy link
Member

Choose a reason for hiding this comment

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

Since contracts are monomorphic over seal type, we do not need close_method in bundles anymore

@@ -581,10 +600,10 @@ impl<
});
continue;
}
if !self.layers1.contains(&seal.layer1()) {
if self.layer1 != seal.layer1() {
Copy link
Member

Choose a reason for hiding this comment

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

Wait, seals always belong to the same layer1, the contract belongs to.

@zoedberg
Copy link
Contributor Author

I do not see how 3030a3f handles reorgs; a new enum field is not used at all

@dr-orlovsky Please start reviewing fixes from RGB-WG/rgb-tests#30. Many fixes required changes to multiple repos. For example the "handle RGB reorgs" fix required changes to both rgb-core and rgb-std, you can see this in RGB-WG/rgb-tests@2d00297

I believe we do not need bundles to commit to the close method, that is excessive
The support of multi-blockchain contracts is still there. Overall, the type XChain needs to be removed - and you will see how many remnants are still haven't dealt with.

I'm aware of this but removing the close method from the bundle and the XChain from multiple objects requires a lot of refactor so we decided that for know we accept to have some redundant bytes in the consignment and some extra unneeded code to avoid making too difficult reviewing the PRs. Especially if no one proves that keeping them could cause a bug/attack. We'll do some refactor PRs after we agree these ones are fixing known bugs or adding limitations that we agreed on during Lugano (i.e. contract committing to single chain and close method).

@dr-orlovsky
Copy link
Member

Sorry, for the last four days I was sick and kinda braindead...

I see your point. Let's discuss it during the call today - there are some risks I see with it.

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.

2 participants