-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: batch deposit&withdraw workflow #190
Conversation
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.
lgc get-balance 0x***** -n testnet_v1
(node:20215) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
l1-address: ckb1qz0n46hjl3pe2jwtepcvv5ehf9p6l94qvk9addgmarvfsvvrum6j7qgpje4npetk5nt8xxvkwj953ht8e9809yr8qq0h6x88
l1-balance: 0.0
l2-address: 0x966B30e576A4d6731996748B48Dd67C94eF29067
l2-balance: 592231.102233887316314413
I got a wrong l1-address. ckb...
is mainnet address.
Not urgent, maybe we can check and fix it later.
This is a bug in branch |
export function privateKeyToDerivedAccounts(privateKey: HexString, count: number): DerivedAccount[] { | ||
const keys: HexString[] = [privateKey]; | ||
for (let i = 0; i < count; i++) { | ||
const newKey = '0x' + keccak256(keys[keys.length - 1]).toString('hex'); |
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.
secp256k1 private key has a max value, not sure the key generated here is always a valid key.
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.
You're right, is it enough to set the max count to 64
?
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.
It seems not related to max try count, a new key is a hash of previous key, so the key looks not incrementing.
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.
I've added TODOs to derived accounts relevant methods, this part of content will be refactored with hd-wallet.
e0c3734
to
8c5b670
Compare
8c5b670
to
890b275
Compare
c9ca3e0
to
2a61a89
Compare
After running in my repo for a long time, the workflow is now stable. |
Description
This PR provides a workflow to run on GitHub Actions (triggered manually).
The workflow is about
Batch deposit & withdraw
, in which we will try to make several rounds of deposit and withdraw for a group of accounts in a short period of time, to see if there will be problems with Godwoken on alphanet_v1.Changes
batch-prepare
workflow to claim faucet for derived accounts in batch actionsbatch-deposit-withdraw
for long-running testing on alphanet_v1Details
How to get started:
batch-prepare
workflow and it should automatically claim L1&L2 capacity for the derived accounts, and transfer test sUDT from a default issuer account to the derived accountsbatch-deposit-withdraw
workflow and it should keep sending batch deposit and withdrawal transactions whenever the Godwoken block number changes (For now the workflow will run for 180 minutes, later we shall make it run for 240 minutes, and start a new workflow every 240 minutes)Terms:
secrets.GODWOKEN_TEST_PRIVATE_KEY
TODO:
batch-prepare
batch-deposit-withdraw
blockNumber