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: add tx filterer docs, fix minor mistakes #996

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion docs/.vuepress/sidebar/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ export const enSidebar = sidebar({
link: "/zk-stack/concepts/data-availability/overview.md"
},
{
text: "Recreating State form L1",
text: "Recreating State from L1",
link: "/zk-stack/concepts/data-availability/recreate-l2-state-from-l1-state-diffs.md"
},
{
Expand Down
10 changes: 10 additions & 0 deletions docs/build/developer-reference/l1-l2-interop.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ L1 to L2 communication is governed by the [`IZkSync.sol`](https://github.com/mat
- If you prefer to learn-by-doing, the [cross chain governance tutorial](../tutorials/smart-contract-development/cross-chain-tutorial.md) is a practical example of layer interoperability.
:::

#### L1 to L2 transaction filtering

A hyperchain operator can filter L1→L2 transactions coming through the Diamond proxy. It is achieved by having an
address of the special contract, responsible for transaction filtering, in the state transition storage. If the filterer
exists, it is being called in the [Mailbox facet](https://github.com/matter-labs/era-contracts/blob/dev/l1-contracts/contracts/state-transition/chain-deps/facets/Mailbox.sol#L243)
Copy link
Collaborator

Choose a reason for hiding this comment

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

These links are for the dev branch. As these are not live, do we want to hold off on merging these changes until 1.5.0 is live?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it makes sense to wait for 1.5.0 before merging. I'll keep track of it and ping you when it's ready to be merged

with the tx details and has to return whether the transaction can be executed or not. If you want to use this feature,
you have to deploy a contract that implements the [`ITransactionFilterer` interface](https://github.com/matter-labs/era-contracts/blob/dev/l1-contracts/contracts/state-transition/chain-interfaces/ITransactionFilterer.sol#L8)
and set its address in the admin facet's [`setTransactionFilterer`](https://github.com/matter-labs/era-contracts/blob/dev/l1-contracts/contracts/state-transition/chain-deps/facets/Admin.sol#L95)
function. The same setter can be used to remove the filterer, it has to be called with the `0` address.

### Gas estimation

The SDK processes gas estimation for transactions implicitly. However, it is also possible to implement the gas estimation processes explicitly.
Expand Down
2 changes: 1 addition & 1 deletion docs/zk-stack/components/shared-bridges.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ be able to leverage them when available).
Hyperchain.
- `Facets` and `Verifier` are shared across chains that relies on the same ST: `Base`, `Executor` , `Getters`, `Admin`
, `Mailbox.`The `Verifier` is the contract that actually verifies the proof, and is called by the `Executor`.
- Upgrade Mechanism The system requires all chains to be up-to-date with the latest implementation, so whenever an
- `Upgrade Mechanism` The system requires all chains to be up-to-date with the latest implementation, so whenever an
update is needed, we have to “force” each chain to update, but due to decentralization, we have to give each chain a
time frame (more information in the
[Upgrade Mechanism](https://www.notion.so/ZK-Stack-shared-bridge-alpha-version-a37c4746f8b54fb899d67e474bfac3bb?pvs=21)
Expand Down
4 changes: 2 additions & 2 deletions docs/zk-stack/components/smart-contracts/smart-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Implementation detail - function returns a magic value just like it is designed

Bridges are completely separate contracts from the Diamond. They are a wrapper for L1 <-> L2 communication on contracts
on both L1 and L2. Upon locking assets on L1, a request is sent to mint these bridged assets on L2. Upon burning assets
on L2, a request is sent to unlock them on L2.
on L2, a request is sent to unlock them on L1.

Unlike the native Ether bridging, all other assets can be bridged by the custom implementation relying on the trustless
L1 <-> L2 communication.
Expand Down Expand Up @@ -288,4 +288,4 @@ struct Deposit {
```

Currently, the limit is used only for blocking deposits of the specific token (turning on the limitation and setting the
limit to zero). And on the near future, this functionality will be completely removed.
limit to zero). And in the near future, this functionality will be completely removed.
3 changes: 1 addition & 2 deletions docs/zk-stack/components/zkEVM/bootloader.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ We also ensure that transactions do not exceed the limits of the memory space al

## Transaction Types and Validation

While the main transaction format is the internal []`Transaction`
format](<https://github.com/code-423n4/2023-10-zksync/blob/ef99273a8fdb19f5912ca38ba46d6bd02071363d/code/system-contracts/contracts/libraries/TransactionHelper.sol#L25>),
While the main transaction format is the internal [`Transaction` format](https://github.com/matter-labs/era-contracts/blob/main/system-contracts/contracts/libraries/TransactionHelper.sol#L25),
it is a struct that is used to represent various kinds of transactions types. It contains a lot of `reserved` fields
that could be used depending in the future types of transactions without need for AA to change the interfaces of their
contracts.
Expand Down
Loading