-
Notifications
You must be signed in to change notification settings - Fork 5
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
Integration with Avail DA layer in Arbitrum nitro stack #9
Integration with Avail DA layer in Arbitrum nitro stack #9
Conversation
RISHABHAGRAWALZRA
commented
May 2, 2024
•
edited
Loading
edited
- Addition of Avail package with having store and retrieve logic in das
- Support for on-chain da verification using Vectorx and Avail bridge
- Addition of Avail in replay binary for fraud proving in the Arbitrator
- Support for Common read da interface based on Unified reader interface for Data Availability providers OffchainLabs/nitro#2155
sequencing attempts to send broadcast messages this gets stuck if broadcast server isn't started and deadlocked in case of ForceSequenceDelayed
…node_start arbnode: init broadcast server before sequencing
feat: enable fraud proof, resolved validation error
nitro v2.1.3 -> nitro v2.2.5 + avail integration
…rification-v2.2.5
Arbitrum Nitro v2.3.1
feat: integrated with common da interface OffchainLabs#2155
@@ -165,6 +166,55 @@ func parseSequencerMessage(ctx context.Context, batchNum uint64, batchBlockHash | |||
return parsedMsg, nil | |||
} | |||
|
|||
func RecoverPayloadFromAvailBatch(ctx context.Context, batchNum uint64, sequencerMsg []byte, availDAReader avail.DataAvailabilityReader, preimages map[arbutil.PreimageType]map[common.Hash][]byte) ([]byte, error) { |
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.
can we reduce the number of arguments and split using few internal functions
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.
No, it can't be changed, RecoverPayloadfromAvailBatch
is inheriting the OffchainLabs#2155
DataAvailabilityProvider
interface:- https://github.com/OffchainLabs/nitro/pull/2155/files#diff-e24cacc680b8e01e6610107edccd3114f681d583376a9ffc9614fa87df314b32R307
} | ||
|
||
func NewAvailDA(cfg DAConfig, l1Client arbutil.L1Interface) (*AvailDA, error) { | ||
|
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.
cleanup
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.
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.
NewAvailDA
can't be divided into smaller functions, because or NewAvailDA
function will not justify the structure of the AvailDA
struct :- https://github.com/availproject/avail-nitro-adapter/pull/9/files#diff-135aa9566bddd6854e4e62dd4405662f9f36b2bf877463c9e7a11ee211ec5a40R31, As per good code design everything should be initialized separately here
das/avail/avail.go
Outdated
log.Error("❌ unable to get sender address from extrinsic", "err", err) | ||
} | ||
|
||
if ext_Addr == Address && ext.Signature.Nonce.Int64() == Nonce.Int64() { |
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.
best to abstract this part into a smaller functions
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.
done in commit 154e91e
) | ||
|
||
func TestMarshallingAndUnmarshalingBlobPointer(t *testing.T) { | ||
extrinsicIndex := 1 |
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.
again just cleanup
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.
154e91e - done
das/avail/utils.go
Outdated
|
||
var localNonce uint32 = 0 | ||
|
||
func GetAccountNonce(accountNonce uint32) uint32 { |
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.
remove this
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.
Yes, take care of in 154e91e
} | ||
|
||
func QueryMerkleProofInput(blockHash string, extrinsicIndex int, t int64) (MerkleProofInput, error) { | ||
// Quering for merkle proof from Bridge Api |
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.
please clean up
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.
Done in 154e91e
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.
Sorry, I approved this PR by mistake!
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.
Accidentally approved before