Using `esc_attr( get_block_wrapper_attributes() )`, results in `class=””wp-block-foo””`

Use the wp_kses_data function to escape the data. See the official Gutenberg examples repo for an example