Problem
When a room contract is migrated to a new WASM version, the migration code sends an upgrade pointer UPDATE to the old contract. This UPDATE fails with:
UPDATE operation failed: invalid contract update, reason: State verification failed: Invalid signature: signature error
This was observed in the browser console while the UI migrated room XQTMFW5V from old contract oW3AFr9RE15sm9d1dZwEQVMjaNJKwsyNbGUP1ptekE6 to new contract GD238LC8mu6FHfp33w9DVATyKaCa9n5CNnKUzyANzodj.
Root Cause
In ui/src/components/app/freenet_api/room_synchronizer.rs around line 449-453, the upgrade state is constructed as:
let upgrade_state = ChatRoomStateV1 {
upgrade: OptionalUpgradeV1(Some(authorized_upgrade)),
..Default::default() // ← BUG: empty/invalid state for all other fields
};
The ..Default::default() produces an empty configuration (with zeroed owner_member_id), empty members, etc. The old contract's state verification checks the entire submitted state for consistency and rejects it because the configuration fields are invalid/empty.
Expected Behavior
The upgrade pointer should be sent as a delta (not a full state replacement), or the full current room state should be included alongside the upgrade pointer so the old contract's validation passes.
Steps to Reproduce
- Have a room created with an older contract version
- Connect with a new River UI that triggers contract migration
- Observe the console error:
UPDATE operation failed: ... Invalid signature: signature error
Impact
- The upgrade pointer is never set on the old contract
- Other clients can't follow the migration pointer to the new contract
- The new contract subscription eventually fails with repeated timeout errors
Related
Problem
When a room contract is migrated to a new WASM version, the migration code sends an upgrade pointer UPDATE to the old contract. This UPDATE fails with:
This was observed in the browser console while the UI migrated room
XQTMFW5Vfrom old contractoW3AFr9RE15sm9d1dZwEQVMjaNJKwsyNbGUP1ptekE6to new contractGD238LC8mu6FHfp33w9DVATyKaCa9n5CNnKUzyANzodj.Root Cause
In
ui/src/components/app/freenet_api/room_synchronizer.rsaround line 449-453, the upgrade state is constructed as:The
..Default::default()produces an emptyconfiguration(with zeroedowner_member_id), empty members, etc. The old contract's state verification checks the entire submitted state for consistency and rejects it because the configuration fields are invalid/empty.Expected Behavior
The upgrade pointer should be sent as a delta (not a full state replacement), or the full current room state should be included alongside the upgrade pointer so the old contract's validation passes.
Steps to Reproduce
UPDATE operation failed: ... Invalid signature: signature errorImpact
Related