-
Notifications
You must be signed in to change notification settings - Fork 429
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
Separate out the DA client into a separate binary #2533
base: master
Are you sure you want to change the base?
Conversation
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.
Looks good! Just minor comments.
daprovider/util.go
Outdated
|
||
// RecordPreimagesTo takes in preimages map and returns a function that can be used | ||
// In recording (hash,preimage) key value pairs into preimages map, when fetching payload through RecoverPayloadFromBatch | ||
func RecordPreimagesTo(preimages map[arbutil.PreimageType]map[common.Hash][]byte) PreimageRecorder { |
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 saw this long type map[arbutil.PreimageType]map[common.Hash]
in multiple places. Maybe create a type alias for it?
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 this is a good idea and have aliased this as PreimagesMap
for now. I don't foresee any issue with this but flagging this to @Tristan-Wilson to double check
I think I need some help understanding this PR, can you make some diagrams showing the relations between the components and what some typical configurations would look like? |
I've added the diagram showing the relations between components to the title comment. |
@@ -0,0 +1,216 @@ | |||
package main |
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.
cmd/ should have only small things that are only relevant to the binaries.
so this file makes sense here, but the "das" and "dasserver" subdirs should be moved somewhere else.
I think I do like the fact you removed it from "arbstate".. maybe under "/daprovider" or somewhere else?
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.
Makes sense! I also moved dasserver inside das directory since it made more sense to be placed in there
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.
You'll need to add --rpc-server-body-limit
which is present in daserver
to daprovider
to allow it to handle batch bodies larger than 5MB.
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.
In this PR the batch poster is trusting the response of the daprovider, authenticated by JWT. Can we require that #2371 is enabled if daprovider is used for extra assurance?
dasServer, closeFn, err := dasserver.NewServer(ctx, &serverConfig, dataSigner, l1client, l1Reader, deployInfo.SequencerInbox) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
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.
If this is being initialized in the same process what's the point of communicating over TCP at all?
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 the reasoning here is we would like to demonstrate that the current design and implementation works.
Redirecting to @PlasmaPower for confirmation.
This PR introduces
daclient
library and--da-provider
config option that can be used to connect a node to any external DA service that implements the unified reader and writer interfaces while adhering to the response formats,...Result
structs, available in/daprovider/daclient/daclient.go
.We also separate out the current data availability implementation (das) into a new binary
daprovider
that can be used to start adas-server
which can in turn be used as a daprovider option above. To maintain backwards compatibility a nitro node does the above step by default when--data-availability
config is provided.(note:
da-provider
anddata-availability
cannot be enabled together`)Thus enabling da providers to efficiently connect to nitro without having to alter any of the source code.
Below is the diagram showing multiple components and their working involved in this PR-
![Screenshot 2024-08-07 at 3 04 44 PM](https://private-user-images.githubusercontent.com/24912546/355760412-3f64c704-04c2-4fd5-85e5-586df2a6a103.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxNDg0MjUsIm5iZiI6MTcyNjE0ODEyNSwicGF0aCI6Ii8yNDkxMjU0Ni8zNTU3NjA0MTItM2Y2NGM3MDQtMDRjMi00ZmQ1LTg1ZTUtNTg2ZGYyYTZhMTAzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTEyVDEzMzUyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU3NGYxZmIyYjIzNjE2NDZhOGRkMDc0MzdmNzg4NzkzM2MxZTY3NTM3ZWQwYmRhM2ZhMDU0N2RkMWE4YjY2ZjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ffMk8gXn3WbFk4D9mGXbu1WeL8LSntL4841o07_ntnE)
Resolves NIT-1158