move ser_length to tools.py, update protobuf