Fix historical test error, write currentcost consumption in sudo