naive: l2 csv first data collation

collects block number, gas prices, and timestamps into one structure.
not finished.
This commit is contained in:
drbeefsupreme 2022-03-15 20:05:25 -04:00
parent 674e872d47
commit 758138d397
No known key found for this signature in database
GPG Key ID: B70D5683DE7F9EFC

View File

@ -86,17 +86,30 @@
=/ block-jar=(jar @ud @ux) (block-tx-jar l2-logs)
;< timestamps=(map @ud @da) bind:m (get-timestamps blocks)
;< gas-prices=(map @ux @ud) bind:m (get-gas-prices tx-hashes)
(pure:m !>(block-jar))
:: ++ collate-roll-data
:: |= $: blocks=(list @ud)
:: l2-logs=events
:: timestamps=(list [block=@ud timestamp=@da])
:: gas-prices=(list [@ux @ud])
:: ==
:: =| block-map=(map @ud [timestamp=@da (list roll-data)])
:: |-
:: ?~ blocks block-map
:: =/ block=@ud i.block
=/ rolling (collate-roll-data blocks block-jar timestamps gas-prices)
(pure:m !>(rolling))
::
++ collate-roll-data
|= $: blocks=(list @ud)
block-jar=(jar @ud @ux)
::l2-logs=events
timestamps=(map @ud @da)
gas-prices=(map @ux @ud)
==
=| block-map=(map @ud [timestamp=@da gas=(map @ux @ud)])
|-
?~ blocks block-map
=/ block i.blocks
=/ tx-hashes (~(get ja block-jar) block)
=/ tx-gas=(map @ux @ud)
%- ~(gas by *(map @ux @ud))
%+ turn tx-hashes
|= txh=@ux
[txh (~(got by gas-prices) txh)]
%= $
blocks t.blocks
block-map (~(put by block-map) block [(~(got by timestamps) block) tx-gas])
==
::
++ get-gas-prices
|= tx-hashes=(list @ux)