near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.31k stars 618 forks source link

fix: prevent num parts configuration error by enforcing panic #11609

Open bowenwang1996 opened 3 months ago

bowenwang1996 commented 3 months ago

On statelessnet we observed that a configuration issue caused a hard-to-debug problem with chunk misses that is caused by num_total_parts being smaller than the number of block producers. This change prevents this configuration error from happening by panicking the node if the local client's protocol version would cause such a violation of invariant. A potentially more complete fix is to add epoch_id as an argument to num_total_parts, but we don't really need that right now and this fix is simpler.

bowenwang1996 commented 3 months ago

Some tests still need to be fixed