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

change StartWriteBatch #140

Closed
wants to merge 1 commit into from
Closed

Conversation

pfi79
Copy link
Contributor

@pfi79 pfi79 commented Jan 16, 2025

@pfi79 pfi79 requested a review from a team as a code owner January 16, 2025 07:11
@pfi79 pfi79 requested a review from C0rWin January 16, 2025 07:12
Signed-off-by: Fedor Partanskiy <[email protected]>
@bestbeforetoday
Copy link
Member

What do we expect the smart contract implementation to do based on the return value from StartWriteBatch()? Does the smart contract implementation logic need to do something different, like avoid calling other batching operations, or can it continue unchanged?

If the smart contract logic needs to react to the return value, the documentation should probably be clear about what action needs to be taken.

If the smart contract code can be identical regardless of return value, maybe it's not necessary.

@pfi79
Copy link
Contributor Author

pfi79 commented Jan 16, 2025

What do we expect the smart contract implementation to do based on the return value from StartWriteBatch()? Does the smart contract implementation logic need to do something different, like avoid calling other batching operations, or can it continue unchanged?

If the smart contract logic needs to react to the return value, the documentation should probably be clear about what action needs to be taken.

If the smart contract code can be identical regardless of return value, maybe it's not necessary.

Currently, the return value of StartWriteBatch() will only affect the call to ResetWriteBatch().
If it returns true, the ResetWriteBatch() call will reset the batched changes and they will not pass to the peer.
If it returns false, the ResetWriteBatch() call will not change the data that has already changed, it has already passed to the peer.

@denyeart
Copy link
Contributor

This is a good example of the complexity that I'd like to avoid. The existence of ResetWriteBatch is now bleeding into other APIs. I'd prefer to eliminate ResetWriteBatch and the extra baggage that it brings along.

@pfi79 pfi79 closed this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants