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

Future Work: Replace synchronous block delivery with asynchronous #240

Open
0x19 opened this issue Jun 30, 2023 · 3 comments
Open

Future Work: Replace synchronous block delivery with asynchronous #240

0x19 opened this issue Jun 30, 2023 · 3 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@0x19
Copy link
Contributor

0x19 commented Jun 30, 2023

Right now block production from sequencers is slow. It can produce only 1 block in 10-15s interval. In order to change that, when we are submitting blocks to avail, we should wait only for initial block acceptance status. However, that feature is not working correctly in the go substrate library github.com/centrifuge/go-substrate-rpc-client/v4 and needs to be resolved.

Following line of code would need to be replaced:
https://github.com/availproject/op-evm/blob/main/consensus/avail/sequencer.go#L517

@0x19 0x19 added bug Something isn't working enhancement New feature or request labels Jun 30, 2023
@cpp-phoenix
Copy link

@0x19 Please assign it to me

@0x19 0x19 assigned 0x19 and cpp-phoenix and unassigned 0x19 Dec 15, 2023
@0x19
Copy link
Contributor Author

0x19 commented Dec 15, 2023

@cpp-phoenix assigned.

@cpp-phoenix
Copy link

Hey @0x19, I've narrowed down the issue to below line of code. Can you please help me understand what exactly is the issue with the gsrpc library here. Which status should depict initial block acceptance and what are we getting currently?

for {
		select {
		case status := <-sub.Chan():
			_, err := dstatus.MarshalJSON()
			if err != nil {
				panic(err)
			}
			// NOTE: See first line of this function for supported extrinsic status expectations.
			switch {
			case dstatus.IsFinalized && status.IsFinalized:
				return nil
			case dstatus.IsInBlock && status.IsInBlock:
				return nil
			case dstatus.IsReady && status.IsReady:
				return nil
			default:
				if status.IsDropped || status.IsInvalid {
					return fmt.Errorf("unexpected extrinsic status from Avail: %#v", status)
				}
			}
		case err := <-sub.Err():
			// TODO: Consider re-connecting subscription channel on error?
			return err
		}
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants