matter-labs / foundry-zksync

Fork of Foundry tailored for zkSync environment
Apache License 2.0
299 stars 130 forks source link

More specific error than `Broken Pipe` #669

Open Karrq opened 2 weeks ago

Karrq commented 2 weeks ago

While compiling we write the compiler input as json to zksolc’s stdin - this is fine but sometimes zksolc will error and close before we are done writing the input to stdin.

This leads to the “Broken Pipe” error we often see.

A workaround for this would be to not propagate the error that serde throws immediately (with ?) but instead print the command’s stderr (if available) first, then returning the error - this way we can more easily troubleshoot the cause