-
Notifications
You must be signed in to change notification settings - Fork 39
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
On-chain node configuration #337
base: main
Are you sure you want to change the base?
Conversation
2a14fec
to
7cb08d8
Compare
/// @param inputBox The input box contract address | ||
/// @param fromBlock Height of first Espresso block to consider | ||
/// @param namespaceId The Espresso namespace ID | ||
function InputBoxAndEspresso( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure InputBoxAndEspresso
should be part of a global official DataAvailability
interface. I am expecting people to be able to add their own without messing with our contracts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good to have at least the ones we fully support defined here so that deployment front-ends and the node can utilize the same definitions. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
People can still provide their own DA config blobs on deployment, and hack their own DA provider node plug-in that understands and decodes that blob.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, if someone wants to add a new DA signature, they can just open a PR. It won't affect the bytecode of our deployed contracts, and therefore won't trigger any redeployments. Therefore, we can release minor versions with these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm I see. But "fully supporting" an integration is a complicated term, and I'm still not very comfortable with our regular contracts mentioning specific integrations/extensions, I feel it should be separate. Couldn't these signatures be placed in separate interfaces?
I'd like to hear other opinions, maybe @pedroargento or @tuler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could totally place these definitions in a third place, but it is convenient to place them here because the rollups-node
repo already uses the artifacts from rollups-contracts
(which includes contracts/interface ABIs), and front-ends often depend on the @cartesi/rollups
npm package to interact with our contracts (e.g. when deploying).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But yeah, we could create a new repo (e.g. rollups-da-config
) with just this file, which would not be imported by rollups-contracts
, but would be imported/used by the node and deployment front-ends.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not very comfortable with our regular contracts mentioning specific integrations/extensions
Our regular contracts are not mentioning integrations/extensions. If you were to draw a dependency graph of the rollups-contracts
with this PR, this interface would be isolated from every other contract. It would not be referenced by any other contract, and therefore not influence any of them. That's why we could, in theory, move it to a separate repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear that I'm not advocating to moving it to somewhere else. I think it's okay to keep it here. If this interface grows out of control, we can think about create a dedicated repo for it.
@@ -41,6 +41,10 @@ contract Application is | |||
/// @dev See the `getConsensus` and `migrateToConsensus` functions. | |||
IConsensus internal _consensus; | |||
|
|||
/// @notice The data availability solution. | |||
/// @dev See the `getDataAvailability` function. | |||
bytes internal _dataAvailability; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why bytes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, why not a ERC-165 contract?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because with bytes
we can encode more data specific to that application.
For example, applications that use Espresso would specify their namespace and Espresso block height.
I'm not a solidity dev to judge this well. In a sane language, which I guess it not solidity, I'd expect a usage like:
|
Yes, this solution could work, but then you would have to deploy this data availability contract for every application that uses Espresso. In reality, we don't need polymorphism. We only need algebraic data types, as in Haskell or Rust: enum DataAvailabilityConfig {
InputBox { inputBoxContract: Address },
InputBoxAndEspresso { inputBoxContract: Address, fromBlock: Uint256, namespaceId: Uint32 },
} The way we are encoding algebraic data types in Solidity is as ABI-encoded function calls. |
You have to agree that is a very non-idiomatic way of expressing algebraic types. 😵💫 |
Unfortunately, that is the best way I know of expressing algebraic types in Solidity. |
No description provided.