This implements #95: When a building owner updates the configuration (service and DEX fee), this no longer takes place immediately. Instead, it starts a new type of ongoing operation for a "delayed update", and only changes the building configuration after a certain number of blocks (120 on mainnet, 10 on regtest). This prevents frontrunning attacks against users of the building.
As a side effect, this also changes the game-state JSON format for the building configuration. Instead of returning dexfee and servicefee directly inside the building JSON, they are now wrapped into a new config sub-object (whose format is reused for the delayed-update ongoing operations). Fields are only present in there if they are actually set vs. being the default value of 0.
This implements #95: When a building owner updates the configuration (service and DEX fee), this no longer takes place immediately. Instead, it starts a new type of ongoing operation for a "delayed update", and only changes the building configuration after a certain number of blocks (120 on mainnet, 10 on regtest). This prevents frontrunning attacks against users of the building.
As a side effect, this also changes the game-state JSON format for the building configuration. Instead of returning
dexfee
andservicefee
directly inside the building JSON, they are now wrapped into a newconfig
sub-object (whose format is reused for the delayed-update ongoing operations). Fields are only present in there if they are actually set vs. being the default value of 0.