add FriendChain if defined and if in local or grid mode (dont know if working for proof)
added enums used in upstream code
added enums used in upstream code