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

Make transaction order flexible #199

Open
rmeissner opened this issue Apr 19, 2020 · 5 comments
Open

Make transaction order flexible #199

rmeissner opened this issue Apr 19, 2020 · 5 comments
Labels
future Features for next major contract version

Comments

@rmeissner
Copy link
Member

rmeissner commented Apr 19, 2020

Currently the transactions need to be executed in strict order of the nonce (as a normal ethereum transaction). This was done to save gas and to ensure that specific actions (adding owners/ removing owners/ changing threshold) don't get mixed up.

By adjusting that adding/ removing owner increments/ decrements the threshold by 1 instead of allowing to specify the threshold can prevent issue with potential owner changes mess ups (see formal verification for details)

If the order of transaction is important (which normally means that the transactions depend on each other) then batched transactions should be used.

The increase in gas costs can be minimized to a couple thousand gas by using a bucket based strategy (each storage slot can store up to 256 flags for used nonces).

@rmeissner rmeissner added the future Features for next major contract version label Apr 19, 2020
@tschubotz
Copy link
Member

By adjusten that adding/ removing owner increase/ decrease the threshold instead of allowing to specify the threshold can prevent issue with potential owner changes mess ups (see formal verification for details)

You mean for those actions, the nonce cannot be an "out of order" nonce, but rather an incremental one, right?

@rmeissner
Copy link
Member Author

rmeissner commented Apr 20, 2020

For clarification here an example scenario:

Let's assume you have a Safe with owners A, B, C and threshold 2
If you now have 2 transactions:

  • Add D and increase threshold to 3
  • Remove C and reduce threshold to 1

It has different end states depending on the order you execute them in.
If you change the logic of these transactions to:

  • Add D and increase threshold by 1
  • Remove C and decrease threshold by 1

Then the endstate is fix no matter what order you execute them in (and the state change of each single transaction is the same as before)

@rmeissner
Copy link
Member Author

@RenanSouza2
Copy link
Contributor

@mmv08 is this something you would like to be persued for release 1.5?

@mmv08
Copy link
Member

mmv08 commented Jul 1, 2023

No, because this is a breaking change. We're also tens of bytes away from the code size limit, so this would be impossible to include.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future Features for next major contract version
Projects
None yet
Development

No branches or pull requests

4 participants