Hmm... xdr_id_type matching largest_id_type is definitely the way to start.  But what I'd do is put those stored encoding sizes in the new format version's header *anyway*, write them out with sizeof(xdr_id_type), when when reading them back in assert that they match sizeof(xdr_id_type).  That will at least make it easier for people to figure the problem out once the inevitable "he wrote this file with 4 byte ints, but I'm configured to use 8 byte ints" or vice-versa occurs, and it'll mean that we can make the reader and writer code more flexible later without requiring another format change.