Migrate ShardDataTree to use OptionalLong