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

docs(data flow): add force inclusion, L1toL2 messaging #731

Merged
merged 14 commits into from
Sep 17, 2023

Conversation

templexxx
Copy link
Contributor

@templexxx templexxx commented Aug 30, 2023

Summary

Force inclusion:

How it works on multi chain

L1 to L2 messaging:

  1. L1 side
  2. L2 side
  3. Gas fee

TODO

After it has been approved, I will fix markdown issues and submit the English version in this PR and merge

@vercel
Copy link

vercel bot commented Aug 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rooch ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 15, 2023 3:42pm

In multi-chain settlement, we rely on L2 nodes to confirm the state (since the state root of Rooch is not available to the settlement chain alone). Therefore, freezing the sequencer directly will prevent users from withdrawing their assets from L2. For these reasons, we need the sequencer rotation mechanism to be able to serve the malicious nodes even if they are forcibly frozen.
basic roles & contracts layers
Deposits confuse people and can easily be confused with asset transfers. Messaging is much more underlying, while asset transfer (deposits, withdrawals) is just a function realised through messaging. To better reflect this underlying logic, I dropped the use of deposit as the name for L1 to L2 messaging
Deposits confuse people and can easily be confused with asset transfers. Messaging is much more underlying, while asset transfer (deposits, withdrawals) is just a function realised through messaging. To better reflect this underlying logic, I dropped the use of deposit as the name for L1 to L2 messaging
@templexxx templexxx changed the title docs(data flow): tx flow, deposit flow, withdrawal flow (WIP) docs(data flow): add force inclusion, L1toL2 messaging Sep 10, 2023
@templexxx templexxx marked this pull request as ready for review September 10, 2023 16:29
Comment on lines +19 to +20
1. `target`: L2 合约地址
2. `msg`: L2 tx 的 calldata
Copy link
Contributor

Choose a reason for hiding this comment

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

这里感觉需要根据 Rooch 以及 Move 做一下调整。比如 Move 中 target 可能不是一个合约地址,而是一个 module::function,或者直接把当前的 MoveAction 打包进去。不过也可以等有初步 demo 实现的时候再调整。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里写 address 也犹豫了挺久。因为我们是多链,这个合约在 L1 上。我可以写个括号备注 target 可能的类型

Copy link
Contributor

Choose a reason for hiding this comment

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

这篇文档属于技术实现的一部分。之后需要调整一下文档目录结构,把技术实现方案和 highlights 拆分开。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

是的。我也是这样打算的

1. `sequence`: 中继消息序列号
2. `sender`: 消息发送方
3. `target`: L2 合约地址
4. `min_gas_amount`: L2 上允许使用的最小 gas 数量,即对调用 `target` 的估计值。
Copy link
Contributor

Choose a reason for hiding this comment

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

这里为什么是最小,而不是 min_gas_amount?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个值随后会根据 msg 的长度进行估算并加上其他的固定 gas 开销得到 gas_amount

gas_amount = min_gas_amount (target 的调用预估)+ 固定开销 + 消息开销等

Block header information for light nodes needs to meet a certain level of timeliness to break circular arguments
@jolestar
Copy link
Contributor

I merged this PR first.

@jolestar jolestar merged commit fb9003f into rooch-network:main Sep 17, 2023
3 checks passed
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