Skip to content

Commit

Permalink
fix merge errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tsahee committed Mar 13, 2024
1 parent 39d2b22 commit bd65bdc
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions arbcompress/compress_wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ func Decompress(input []byte, maxSize int) ([]byte, error) {
return outBuf[:outLen], nil
}

func compressLevel(input []byte, level uint32) ([]byte, error) {
func compressLevel(input []byte, level int) ([]byte, error) {
maxOutSize := compressedBufferSizeFor(len(input))
outBuf := make([]byte, maxOutSize)
outLen := uint32(len(outBuf))
status := brotliCompress(
arbutil.SliceToUnsafePointer(input), uint32(len(input)),
arbutil.SliceToUnsafePointer(outBuf), unsafe.Pointer(&outLen),
level,
uint32(level),
WINDOW_SIZE,
)
if status != BrotliSuccess {
Expand Down
2 changes: 1 addition & 1 deletion arbitrator/jit/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn main() -> Result<()> {
}
};

let memory_used = instance.exports.get_memory("mem").unwrap().view(&mut store).size().0 as u64 * 65_536;
let memory_used = instance.exports.get_memory("memory").unwrap().view(&mut store).size().0 as u64 * 65_536;

let env = env.as_mut(&mut store);
let user = env.process.socket.is_none();
Expand Down
7 changes: 7 additions & 0 deletions arbitrator/prover/test-cases/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@ package main

import (
"bytes"
"crypto/sha512"
"encoding/hex"
"fmt"
"math/big"
"os"
"runtime"
"sync"
"time"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
merkletree "github.com/wealdtech/go-merkletree"

"github.com/offchainlabs/nitro/arbcompress"
"github.com/offchainlabs/nitro/arbutil"
"github.com/offchainlabs/nitro/wavmio"
)

// MerkleSample is an example using the Merkle tree to generate and verify proofs.
Expand Down
2 changes: 1 addition & 1 deletion arbitrator/wasm-libraries/host-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub unsafe extern "C" fn wavmio__readDelayedInboxMessage(

/// Retrieves the preimage of the given hash.
#[no_mangle]
pub unsafe extern "C" fn wavmio__resolveTypedPreImage(
pub unsafe extern "C" fn wavmio__resolveTypedPreimage(
preimage_type: u8,
hash_ptr: GuestPtr,
offset: usize,
Expand Down
1 change: 1 addition & 0 deletions execution/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state"
"github.com/offchainlabs/nitro/arbos/arbostypes"
"github.com/offchainlabs/nitro/arbutil"
"github.com/offchainlabs/nitro/validator"
Expand Down
2 changes: 1 addition & 1 deletion system_tests/precompile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestCustomSolidityErrors(t *testing.T) {
Fatal(t, "customRevert call should have errored")
}
observedMessage := customError.Error()
expectedError := "Custom(1024, This spider family wards off bugs: /\\oo/\\ //\\(oo)/\\ /\\oo/\\, true)"
expectedError := "Custom(1024, This spider family wards off bugs: /\\oo/\\ //\\(oo)//\\ /\\oo/\\, true)"
// The first error is server side. The second error is client side ABI decoding.
expectedMessage := fmt.Sprintf("execution reverted: error %v: %v", expectedError, expectedError)
if observedMessage != expectedMessage {
Expand Down
2 changes: 1 addition & 1 deletion wavmio/higher.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func AdvanceInboxMessage() {
func ResolveTypedPreimage(ty arbutil.PreimageType, hash common.Hash) ([]byte, error) {
return readBuffer(func(offset uint32, buf unsafe.Pointer) uint32 {
hashUnsafe := unsafe.Pointer(&hash[0])
return resolveTypedPreimage(uint8(ty), hashUnsafe, offset, buf)
return resolveTypedPreimage(uint32(ty), hashUnsafe, offset, buf)
}), nil
}

Expand Down
2 changes: 1 addition & 1 deletion wavmio/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ func readInboxMessage(msgNum uint64, offset uint32, output unsafe.Pointer) uint3
func readDelayedInboxMessage(seqNum uint64, offset uint32, output unsafe.Pointer) uint32

//go:wasmimport wavmio resolveTypedPreimage
func resolveTypedPreimage(ty uint8, hash unsafe.Pointer, offset uint32, output unsafe.Pointer) uint32
func resolveTypedPreimage(ty uint32, hash unsafe.Pointer, offset uint32, output unsafe.Pointer) uint32

0 comments on commit bd65bdc

Please sign in to comment.