Netmap contract update routine #11

Open
opened 2023-03-01 08:47:02 +00:00 by alexvanin · 3 comments
alexvanin commented 2023-03-01 08:47:02 +00:00 (Migrated from github.com)

All FrostFS contracts aside netmap have simple update routine which is defined in if isUpdate branch of _deploy function.
Netmap contract have mandatory system config update and it requires specific arguments format for update function.

4f3c08f552/netmap/netmap_contract.go (L74-L93)

It looks to me as outdated code and it would be nice to have more flexibility in update arguments format for netmap contract. So my propose is to move if isUpdate branch before argument parsing and setConfig call.

All FrostFS contracts aside netmap have simple update routine which is defined in `if isUpdate` branch of `_deploy` function. Netmap contract have mandatory system config update and it requires specific arguments format for update function. https://github.com/TrueCloudLab/frostfs-contract/blob/4f3c08f5521af0ce397c1da522265cad3593ee15/netmap/netmap_contract.go#L74-L93 It looks to me as outdated code and it would be nice to have more flexibility in update arguments format for netmap contract. So my propose is to move `if isUpdate` branch before argument parsing and `setConfig` call.
Owner

Do you meant having different formats for deploy and update?

Do you meant having different formats for `deploy` and `update`?
Owner

Yes. I mean other contracts do not share arguments between deploy and update methods, which seems legit. So it is may looks confusing when netmap contract requires a set of key:value pairs to update contract.

I don't remember was it intentional or not, so there can be useful cases for such update behaviour.

Yes. I mean other contracts do not share arguments between `deploy` and `update` methods, which seems legit. So it is may looks confusing when netmap contract _requires_ a set of key:value pairs to update contract. I don't remember was it intentional or not, so there can be useful cases for such `update` behaviour.
Owner

I think it was there because some time ago we updated netmap contract and then just deleted the update code.

I think it was there because _some time ago_ we updated netmap contract and then just deleted the update code.
snegurochka added the
discussion
label 2023-05-03 17:15:22 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-contract#11
No description provided.