Commit a state transition (update, transfer, revoke, renew, namespace_ready).
        
        Returns the new canonicalized record (with all compatibility quirks preserved)

        DO NOT CALL THIS DIRECTLY

def commit_state_transition( self, nameop, current_block_number ):
        """
        Commit a state transition (update, transfer, revoke, renew, namespace_ready).
        
        Returns the new canonicalized record (with all compatibility quirks preserved)

        DO NOT CALL THIS DIRECTLY
        """

        # have to have read-write disposition 
        if self.disposition != DISPOSITION_RW:
            log.error("FATAL: borrowing violation: not a read-write connection")
            traceback.print_stack()
            os.abort()

        cur = self.db.cursor()
        opcode = nameop.get('opcode', None)
        constraints_ignored = state_transition_get_always_set( nameop )
        transition = self.sanitize_op( nameop )
        
        try:
            assert state_transition_is_valid( nameop ), "Invalid state-transition"
            assert opcode is not None, "No opcode given"
        except Exception, e:
            log.exception(e)
            log.error("FATAL: failed to commit state transition")
            self.db.rollback()
            os.abort()

        table = state_transition_get_table( nameop )
        history_id_key = state_transition_get_history_id_key( nameop )
        account_payment_info = state_transition_get_account_payment_info(nameop)
        history_id = nameop[history_id_key]

        # record must exist...
        if history_id_key == "name":
            cur_record = namedb_get_name( cur, history_id, current_block_number, include_history=False, include_expired=True )

        elif history_id_key == "namespace_id":
            cur_record = namedb_get_namespace( cur, history_id, current_block_number, include_history=False, include_expired=True )

        else:
            raise Exception("Unknown history ID key '%s'" % history_id_key)

        try:
            assert cur_record is not None, "No such record: %s" % history_id
        except Exception, e:
            # should have been caught earlier
            log.exception(e)
            log.error("FATAL: failed to lookup existing record '%s'" % history_id)
            self.db.rollback()
            os.abort()

        self.log_accept( current_block_number, nameop['vtxindex'], nameop['op'], nameop )

        canonical_op = namedb_state_transition( cur, opcode, transition, current_block_number, transition['vtxindex'], transition['txid'],
                                                 history_id, cur_record, table, constraints_ignored=constraints_ignored )
        if not canonical_op:
            log.error("FATAL: failed to update '%s'" % history_id)
            self.db.rollback()
            os.abort()
        
        self.commit_account_debit(opcode, account_payment_info, current_block_number, transition['vtxindex'], transition['txid'])

        return canonical_op