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

Integration with Avail DA layer in Arbitrum nitro stack #9

Merged

Conversation

RISHABHAGRAWALZRA
Copy link
Collaborator

@RISHABHAGRAWALZRA RISHABHAGRAWALZRA commented May 2, 2024

PlasmaPower and others added 29 commits October 25, 2023 10:59
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
@RISHABHAGRAWALZRA RISHABHAGRAWALZRA changed the title 1st Proposal of Integration with Avail DA layer in Arbitrum nitro stack Integration with Avail DA layer in Arbitrum nitro stack May 2, 2024
@@ -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) {
Copy link
Member

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

Copy link
Collaborator Author

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) {

Copy link
Member

Choose a reason for hiding this comment

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

cleanup

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

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

log.Error("❌ unable to get sender address from extrinsic", "err", err)
}

if ext_Addr == Address && ext.Signature.Nonce.Int64() == Nonce.Int64() {
Copy link
Member

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

Copy link
Collaborator Author

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
Copy link
Member

Choose a reason for hiding this comment

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

again just cleanup

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

154e91e - done


var localNonce uint32 = 0

func GetAccountNonce(accountNonce uint32) uint32 {
Copy link
Member

Choose a reason for hiding this comment

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

remove this

Copy link
Collaborator Author

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
Copy link
Member

Choose a reason for hiding this comment

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

please clean up

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done in 154e91e

Copy link

@Tristan-Wilson Tristan-Wilson left a 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!

Copy link

@Tristan-Wilson Tristan-Wilson left a comment

Choose a reason for hiding this comment

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

Accidentally approved before

@RISHABHAGRAWALZRA RISHABHAGRAWALZRA merged commit d8f3c86 into avail-develop-v2.3.1 May 13, 2024
1 of 6 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.

5 participants