Skip to content
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

A limit of mass deposits in a single Propose transaction #382

Open
sifnoc opened this issue Mar 21, 2022 · 1 comment
Open

A limit of mass deposits in a single Propose transaction #382

sifnoc opened this issue Mar 21, 2022 · 1 comment

Comments

@sifnoc
Copy link
Member

sifnoc commented Mar 21, 2022

Currently, the massDeposits which are not included are over 300 in testnet. That was accumulated by long periods of absent coordinators activity. That is a low possible scenario in zkopru protocol in production. Anyway, It happened in testnet and we should be considered that.

The error log shows what happens over the limit of size massDeposits can be included in one Propose tx.

[1647770286864] INFO (3505 on 51f58fd1afd8): Picked txs: 0
[1647770286864] INFO (3505 on 51f58fd1afd8): Pending txs: 0
[1647770286880] INFO (3505 on 51f58fd1afd8): Trying to create a child block of 0xa69837df7fd12f315b8c1fac35ec7146d9114c0a6ccbd0771e8755da5229fd07
[1647770286887] ERROR (3505 on 51f58fd1afd8): Uncaught error in task
[1647770286888] ERROR (3505 on 51f58fd1afd8): Exceeds the given buffer size
    Error: Exceeds the given buffer size
        at hexToBuffer (/src/packages/utils/dist/index.js:123:15)
        at Object.numToBuffer (/src/packages/utils/dist/index.js:174:12)
        at serializeMassDeposits (/src/packages/core/dist/block/utils.js:128:39)
        at Object.serializeBody (/src/packages/core/dist/block/utils.js:157:9)
        at Coordinator.<anonymous> (/src/packages/coordinator/dist/coordinator.js:286:24)
        at Generator.next (<anonymous>)
        at fulfilled (/src/packages/coordinator/dist/coordinator.js:5:58)
[1647770286898] ERROR (3505 on 51f58fd1afd8): coordinator/coordinator.ts - Error occurred during block proposing: Error: Exceeds the given buffer size

Only 255 massDeposits can be included in a single Propose transaction.

const massDepositLenBytes = Utils.numToBuffer(massDeposits.length, 1)

That is possible to happen error in withdrawals MassMigrations. I am not calculating yet. the one inflow, two outflows type of zktxs maximally included around 222, #343 (comment)
That means it possibly over 255 withdrawals zkTx if all zktx has massmigration with 1 inflow 1 outflow type in single propose transaction.

@sifnoc
Copy link
Member Author

sifnoc commented Mar 23, 2022

We should running the coordinator with maxBytes as 65536(= 64 * 1024, 64kb), half of value in current, before fixing calculation of tx size in properly.
the remains is for massMigration space in propose tx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants