Skip to content

Conversation

pmikolajczyk41
Copy link
Member

@pmikolajczyk41 pmikolajczyk41 commented Sep 23, 2025

Data streaming protocol should be used to send pure bytes, without any other parameters. Therefore:

  • timeout parameter was removed from the protocol level
  • DA client and server (de)serialize message together with the timeout

This opens a clear path for e.g. including other data like on-chain storage fallback flag in other usecases.

We also renamed 'timeout' to 'expiry', which is more accurate in the DA world.

@pmikolajczyk41 pmikolajczyk41 force-pushed the pmikolajczyk/serialize-data-in-data-streaming branch from 8ab5c7f to d11f2e1 Compare September 23, 2025 11:23
@pmikolajczyk41 pmikolajczyk41 changed the title Remove timeout concept from data streaming Remove expiration concept from data streaming Sep 23, 2025
@pmikolajczyk41 pmikolajczyk41 marked this pull request as ready for review September 23, 2025 11:25
Copy link
Member

@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.

Regarding the backwards compatibility comments: we have to be really careful with any changes to the existing AnyTrust API (dasRpcServer). Regarding the daprovider API we can play a lot more fast and loose because it's not widely deployed and we are making major changes to it with the custom-da work.

// lint:require-exhaustive-initialization
type StoreResult struct {
DataHash hexutil.Bytes `json:"dataHash,omitempty"`
Timeout hexutil.Uint64 `json:"timeout,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

I think this isn't backwards compatible, we might have to leave it called "Timeout" in the Store das RPC API.

Expiry uint64
}

func (s *DASRPCServer) StartChunkedStore(ctx context.Context, timestamp, nChunks, chunkSize, totalSize hexutil.Uint64, sig hexutil.Bytes) (*data_streaming.StartStreamingResult, error) {
Copy link
Member

Choose a reason for hiding this comment

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

I like the overall idea of this change, ie moving extra fields like expiry into the payload, but again I think this isn't backwards compatible for existing anytrust deployments and that's a problem given that client and server will have different upgrade schedules. If we have to keep a vestigial parameter on the streaming interface for now it's not the end of the world for now, then we can do a V2 of the RPC API without it to give a migration path.

dasWriter DASWriter
}

func (d *writerForDAS) Store(ctx context.Context, message []byte, timeout uint64, disableFallbackStoreDataOnChain bool) ([]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.

IIRC this adapts from daprovider.Writer to the dasWriter. I think we should be able to remove the expiry parameter from daprovider.Writer and just have this adapter add the expiry. It is currently calculated as uint64(time.Now().Add(config.DASRetentionPeriod).Unix()) in the batch poster, that could just be moved into this adapter.

@Tristan-Wilson
Copy link
Member

This one too will cause a lot of conflicts with #3237. It might be better to make these changes against that branch.

@pmikolajczyk41 pmikolajczyk41 deleted the pmikolajczyk/serialize-data-in-data-streaming branch September 24, 2025 06:59
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.

2 participants