-
Notifications
You must be signed in to change notification settings - Fork 9
Conversation
providers/frame/common.ts
Outdated
await Deno.readTextFile( | ||
new URL(`./test_users/network_${networkPrefix}_user_balances.json`, import.meta.url), | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each network_<prefix>_user_balances.json
weights ~7mb.
I'm not sure what would be best
- keep them in Git
- upload them the something like S3 and cache them in a CDN
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I didn't think about how large the files would be... Can you test to see how much time each part of the generation takes? (text encoding / hashing / sr25519 from seed / ss58 generation) If the text encoding and/or hashing are expensive, we could adopt a different approach for the seed generation, but if the majority of the time is the sr25519 or ss58, we might be out of luck.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. In that case, instead of pre-computing the full addresses, could you just pre-compute the public keys, and then save them into a file using $.array($.sizedUint8Array(32))
? That way it can be the same file across chains, and it should be only around 3.2 MB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if the file is only around 3.2 megs, you can put that in git for now, like we do with the dprint formatter. Later, once I take a look at #709, that file can potentially be moved from git into an s3 cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok. In that case, instead of pre-computing the full addresses, could you just pre-compute the public keys, and then save them into a file using
$.array($.sizedUint8Array(32))
? That way it can be the same file across chains, and it should be only around 3.2 MB.
Great suggestion!
Now, there is a single 3.1MB file
And yeah, star is taking a while to cache... I think maybe the |
I just evicted the deno cache for main, we'll see if that fixes it |
Ah, no, I think it's taking a long time again because @harrysolovay changed the specifiers back to |
Correct: I didn't realize the pinning was intentional / for caching purposes. Apologies. Feel free to revert. |
ed4a12f
to
4830a63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Can you put the code you used to generate that file into _tasks/download.ts
? (at which point it can be renamed to something like generate_artifacts.ts
)
94c1b0b
to
7711a8d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, just one nit
Co-authored-by: T6 <t6@t6.fyi>
This reverts commit 5d04fc2.
Co-authored-by: T6 <t6@t6.fyi>
Resolves #741
The
test_users_public_keys
file was generated withNote that the
star.yml
workflow duration is not impacted by this change