Add record_external_cost to register_cost fn
#643
Merged
record_external_cost to register_cost fn
#643