Skip to content

[Feature Request] add deref_visitor_delegate_simple! for visit_vec_u16, visit_vec_u32, and visit_vec_u256 #17840

@junxzm1990

Description

@junxzm1990

🚀 Feature Request

DerefVisitor (aptos-move/aptos-gas-schedule/src/gas_schedule/misc.rs) does not yet cover visit_vec_u16, visit_vec_u32, and visit_vec_u256. Please consider revisiting this to update.

When upgrading, compatibility needs a closer inspection. Consider visit_vec_u16 as an example. Default implementation is:

fn visit_vec_u16(&mut self, depth: u64, vals: &[u16]) -> PartialVMResult<()> {  
    // same as self.inner.visit_vec(depth - self.offset as u64, vals.len());  
    self.visit_vec(depth, vals.len())?;  
    for val in vals {  
        // Same as self.inner.visit_u16(depth + 1 - self.offset as u64, vals)?;  
        self.visit_u16(depth + 1, *val)?;  
    }  
    Ok(())  
}  

After upgrading, we will have:

fn visit_vec_u16(&mut self, depth: u64, vals: &[u16]) -> PartialVMResult<()> {  
    self.inner.visit_vec_u16(depth - self.offset as u64, vals)?;  
    Ok(())  
} 

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    For Grabs

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions