archiver stores L1ToL2 pending messages#642
Conversation
cf159bd to
bd10daa
Compare
| public getPendingL1ToL2Messages(take: number): Promise<L1ToL2Message[]> { | ||
| // todo: @rahul https://github.com/AztecProtocol/aztec-packages/issues/529 - change this so that sequencer actually actually consumes messages sorted by fee or another value | ||
| // upon consumption, the messages are removed from the store | ||
| return Promise.resolve(this.pendingL1ToL2Messages.slice(0, take)); |
There was a problem hiding this comment.
Does this decrease the size of the existing pendingMessages array? Or does it leave the sampled data there.
| blockUntilSynced: boolean, | ||
| currentBlockNumber: bigint, | ||
| searchStartBlock: bigint, | ||
| ) { |
There was a problem hiding this comment.
Add a type for the return value.
There was a problem hiding this comment.
Ah I tried but it gets quite ugly (which is why none of the methods here have a return type.
Basically you add a return type like : Promise<{ nextEthBlockNumber: bigint; retrievedData: L1ToL2Message[]}> and then the linter says Missing JDoc statement - except the linter wants the jdoc statement in the return statement itself (L143) as opposed to on L135.
There was a problem hiding this comment.
You could make a generic type for each:
/**
* Data retreived from logs
*/
type RollupLog<T> = {
/**
* The next block number.
*/
nextEthBlockNumber: bigint;
/**
* The data returned.
*/
retrievedData: T[];
}Then have the return type be:
func something(): Promise<RollupLog<L1ToL2Message>> {}should do the trick and appease the linter
spalladino
left a comment
There was a problem hiding this comment.
Nothing to add from my end on top of @Maddiaa0 and @LHerskind comments. Feel free to loop in @spypsy if you want a review from an Otter more familiar with the archiver than myself!
bd10daa to
9560afa
Compare
| blockUntilSynced: boolean, | ||
| currentBlockNumber: bigint, | ||
| searchStartBlock: bigint, | ||
| ) { |
There was a problem hiding this comment.
You could make a generic type for each:
/**
* Data retreived from logs
*/
type RollupLog<T> = {
/**
* The next block number.
*/
nextEthBlockNumber: bigint;
/**
* The data returned.
*/
retrievedData: T[];
}Then have the return type be:
func something(): Promise<RollupLog<L1ToL2Message>> {}should do the trick and appease the linter
Description
Next step is the sequencer actually consuming the said messages - this will be a separate PR since this is big enough already.
Fixes #520
Checklist: