diff --git a/arbitrator/prover/src/utils.rs b/arbitrator/prover/src/utils.rs index 400cb58ef..09f534720 100644 --- a/arbitrator/prover/src/utils.rs +++ b/arbitrator/prover/src/utils.rs @@ -219,9 +219,8 @@ pub fn hash_preimage(preimage: &[u8], ty: PreimageType) -> Result<[u8; 32]> { let blob = EigenDABlob::from_padded_bytes_unchecked(preimage); let blob_polynomial = blob - .to_polynomial(PolynomialFormat::InEvaluationForm) - .unwrap(); - let blob_commitment = kzg_bn254.commit(&blob_polynomial).unwrap(); + .to_polynomial(PolynomialFormat::InEvaluationForm)?; + let blob_commitment = kzg_bn254.commit(&blob_polynomial)?; let mut commitment_bytes = Vec::new(); blob_commitment.serialize_uncompressed(&mut commitment_bytes)?; @@ -229,8 +228,6 @@ pub fn hash_preimage(preimage: &[u8], ty: PreimageType) -> Result<[u8; 32]> { let mut commitment_hash: [u8; 32] = Sha256::digest(&commitment_bytes).into(); commitment_hash[0] = 1; - println!("commitment_hash: {:?}", commitment_hash); - Ok(commitment_hash) } } diff --git a/arbitrator/prover/test-cases/rust/src/bin/host-io.rs b/arbitrator/prover/test-cases/rust/src/bin/host-io.rs index 14a982c01..ad510d084 100644 --- a/arbitrator/prover/test-cases/rust/src/bin/host-io.rs +++ b/arbitrator/prover/test-cases/rust/src/bin/host-io.rs @@ -108,25 +108,19 @@ fn main() { let expected_len = 0; - // for i in 0..5{ - // let eigen_hash = hex!("011e229d75b13559dcb2d757ecae9b66fa579268e28e196789503322115c06e1"); - // bytebuffer = Bytes32(eigen_hash); - - // let actual_len = wavm_read_eigen_da_hash_preimage(bytebuffer.0.as_mut_ptr(), i * 32); - - // if i < 4 { - // assert_eq!(actual_len, 32); - // } else { - // assert_eq!(actual_len, 0); - // } - // } - - let eigen_hash = hex!("011e229d75b13559dcb2d757ecae9b66fa579268e28e196789503322115c06e1"); + for i in 0..5{ + let eigen_hash = hex!("011e229d75b13559dcb2d757ecae9b66fa579268e28e196789503322115c06e1"); bytebuffer = Bytes32(eigen_hash); - - let actual_len = wavm_read_eigen_da_hash_preimage(bytebuffer.0.as_mut_ptr(), 1); - assert_eq!(actual_len, 32); + let actual_len = wavm_read_eigen_da_hash_preimage(bytebuffer.0.as_mut_ptr(), i * 32); + + if i < 4 { + assert_eq!(actual_len, 32); + } else { + assert_eq!(actual_len, 0); + } + } } + println!("Done!"); } diff --git a/cmd/replay/main.go b/cmd/replay/main.go index 9809982ac..1c43b6012 100644 --- a/cmd/replay/main.go +++ b/cmd/replay/main.go @@ -154,24 +154,17 @@ type EigenDAPreimageReader struct{} // QueryBlob returns the blob for the given cert from the preimage oracle using the hash of the // certificate kzg commitment for identifying the preimage. func (dasReader *EigenDAPreimageReader) QueryBlob(ctx context.Context, cert *eigenda.EigenDABlobInfo, domain string) ([]byte, error) { - println("Querying EigenDA blob") kzgCommit, err := cert.SerializeCommitment() if err != nil { return nil, err } - println("kzgCommit: ", hex.EncodeToString(kzgCommit)) shaDataHash := sha256.New() shaDataHash.Write(kzgCommit) dataHash := shaDataHash.Sum([]byte{}) dataHash[0] = 1 hash := common.BytesToHash(dataHash) - println("Reading EigenDA blob from preimage oracle: ", hash.String()) - - // 128 byte preimage - // (1) READPREIMAGE -> hash, 0th offset - // (2) READPREIMAGE -> hash, 32 offset preimage, err := wavmio.ResolveTypedPreimage(arbutil.EigenDaPreimageType, hash) if err != nil { return nil, err diff --git a/eigenda/proxy.go b/eigenda/proxy.go index e5942974b..1c2238e8f 100644 --- a/eigenda/proxy.go +++ b/eigenda/proxy.go @@ -44,6 +44,7 @@ func (c *EigenDAProxyClient) Get(ctx context.Context, blobInfo *DisperserBlobInf return nil, fmt.Errorf("failed to encode blob info: %w", err) } + // TODO: support more strict versioning commitWithVersion := append([]byte{0x0}, commitment...) data, err := c.client.GetData(ctx, commitWithVersion, StrToDomainType(domainFilter)) @@ -88,7 +89,6 @@ func StrToDomainType(s string) DomainType { // TODO: Add support for custom http client option type Config struct { - Actor string URL string } @@ -139,10 +139,6 @@ func (c *client) Health() error { func (c *client) GetData(ctx context.Context, comm []byte, domain DomainType) ([]byte, error) { url := fmt.Sprintf("%s/get/0x%x?domain=%s&commitment_mode=simple", c.cfg.URL, comm, domain.String()) - if c.cfg.Actor != "" { - url = fmt.Sprintf("%s&actor=%s", url, c.cfg.Actor) - } - req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil) if err != nil { return nil, fmt.Errorf("failed to construct http request: %e", err)