cherry pick changes from esp3-host