-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add limitation info about dynamic sized variable types #177
Conversation
@sukanyaparashar Looks good to me, I would just rephrase it a bit to make this long sentence clearer: In Solidity versions before |
@@ -83,6 +83,36 @@ Every Solana transaction which corresponds to a particular Neon EVM transaction, | |||
|
|||
If the data emitted by an event is more than 128K bytes, the transaction won't get reverted, but some of the event data won't be stored on-chain, causing some inconsistencies in the data stored. | |||
|
|||
### Usage of dynamic sized variable types | |||
|
|||
There is a limitation in Solidity versions prior to `0.8.15` when using dynamic-sized variable types, such as `strings` and `bytes`, as mapping values in functions that are invoked multiple times. This issue arises because reusing the same parameters of these types in transactions leads to an increased consumption of Solana accounts. |
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 to me, I would just rephrase it a bit to make this long sentence clearer:
In Solidity versions before 0.8.15, there is a limitation when using dynamic-sized variable types, such as strings and bytes, as mapping values in functions invoked multiple times. This issue arises because reusing the same parameters of these types in transactions leads to increased consumption of Solana accounts.
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 very nice!
Have just one question:
in 101: for (uint256 i = 0; i < 45; ++i) {
why do you use here i until 45?
It is just an example of an iteration
This is a really good question! In Solana, each mapping entry corresponds to usage of one Solana account and there is a limit of using 64 Solana accounts in a single transaction. We have used the value That means if there are 45 iterations, then because of double spending issue described in this case, the total accounts used in this transaction will be >64, i.e, 45 * 2 = 90 + 9 = 99 accounts (extra 9 accounts are added by default). |
9ea99aa
to
bc07cfd
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.
Everything is clear, thank you!
This PR adds the point for mentioning the limitation of using dynamic sized variable types
strings
andbytes
.