diff --git a/core/vm/contracts.go b/core/vm/contracts.go index 9f8d7a9623..fd3149b872 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -91,8 +91,8 @@ var PrecompiledContractsSuave = map[common.Address]SuavePrecompiledContract{ isConfidentialAddress: &isConfidentialPrecompile{}, confidentialInputsAddress: &confidentialInputsPrecompile{}, - confStoreStoreAddress: newConfStoreStore(), - confStoreRetrieveAddress: newConfStoreRetrieve(), + confStoreAddress: newconfStore(), + confRetrieveAddress: newconfRetrieve(), newBidAddress: newNewBid(), fetchBidsAddress: newFetchBids(), diff --git a/core/vm/contracts_suave.go b/core/vm/contracts_suave.go index 8cebbd1e37..c65ff57f71 100644 --- a/core/vm/contracts_suave.go +++ b/core/vm/contracts_suave.go @@ -25,8 +25,8 @@ var ( confidentialInputsAddress = common.HexToAddress("0x42010001") - confStoreStoreAddress = common.HexToAddress("0x42020000") - confStoreRetrieveAddress = common.HexToAddress("0x42020001") + confStoreAddress = common.HexToAddress("0x42020000") + confRetrieveAddress = common.HexToAddress("0x42020001") newBidAddress = common.HexToAddress("0x42030000") fetchBidsAddress = common.HexToAddress("0x42030001") @@ -80,25 +80,25 @@ func (c *confidentialInputsPrecompile) RunConfidential(suaveContext *SuaveContex /* Confidential store precompiles */ -type confStoreStore struct { +type confStore struct { inoutAbi abi.Method } -func newConfStoreStore() *confStoreStore { +func newconfStore() *confStore { inoutAbi := mustParseMethodAbi(`[{"inputs":[{"type":"bytes16"}, {"type":"bytes16"}, {"type":"string"}, {"type":"bytes"}],"name":"store","outputs":[],"stateMutability":"nonpayable","type":"function"}]`, "store") - return &confStoreStore{inoutAbi} + return &confStore{inoutAbi} } -func (c *confStoreStore) RequiredGas(input []byte) uint64 { +func (c *confStore) RequiredGas(input []byte) uint64 { return uint64(100 * len(input)) } -func (c *confStoreStore) Run(input []byte) ([]byte, error) { +func (c *confStore) Run(input []byte) ([]byte, error) { return nil, errors.New("not available in this suaveContext") } -func (c *confStoreStore) RunConfidential(suaveContext *SuaveContext, input []byte) ([]byte, error) { +func (c *confStore) RunConfidential(suaveContext *SuaveContext, input []byte) ([]byte, error) { if len(suaveContext.CallerStack) == 0 { return []byte("not allowed"), errors.New("not allowed in this suaveContext") } @@ -118,15 +118,15 @@ func (c *confStoreStore) RunConfidential(suaveContext *SuaveContext, input []byt return nil, nil } -func (c *confStoreStore) runImpl(suaveContext *SuaveContext, bidId suave.BidId, key string, data []byte) error { +func (c *confStore) runImpl(suaveContext *SuaveContext, bidId suave.BidId, key string, data []byte) error { bid, err := suaveContext.Backend.ConfidentialStore.FetchBidById(bidId) if err != nil { return suave.ErrBidNotFound } - log.Info("confStoreStore", "bidId", bidId, "key", key) + log.Info("confStore", "bidId", bidId, "key", key) - caller, err := checkIsPrecompileCallAllowed(suaveContext, confStoreStoreAddress, bid) + caller, err := checkIsPrecompileCallAllowed(suaveContext, confStoreAddress, bid) if err != nil { return err } @@ -143,21 +143,21 @@ func (c *confStoreStore) runImpl(suaveContext *SuaveContext, bidId suave.BidId, return nil } -type confStoreRetrieve struct{} +type confRetrieve struct{} -func newConfStoreRetrieve() *confStoreRetrieve { - return &confStoreRetrieve{} +func newconfRetrieve() *confRetrieve { + return &confRetrieve{} } -func (c *confStoreRetrieve) RequiredGas(input []byte) uint64 { +func (c *confRetrieve) RequiredGas(input []byte) uint64 { return 100 } -func (c *confStoreRetrieve) Run(input []byte) ([]byte, error) { +func (c *confRetrieve) Run(input []byte) ([]byte, error) { return nil, errors.New("not available in this suaveContext") } -func (c *confStoreRetrieve) RunConfidential(suaveContext *SuaveContext, input []byte) ([]byte, error) { +func (c *confRetrieve) RunConfidential(suaveContext *SuaveContext, input []byte) ([]byte, error) { if len(suaveContext.CallerStack) == 0 { return []byte("not allowed"), errors.New("not allowed in this suaveContext") } @@ -173,13 +173,13 @@ func (c *confStoreRetrieve) RunConfidential(suaveContext *SuaveContext, input [] return c.runImpl(suaveContext, bidId, key) } -func (c *confStoreRetrieve) runImpl(suaveContext *SuaveContext, bidId suave.BidId, key string) ([]byte, error) { +func (c *confRetrieve) runImpl(suaveContext *SuaveContext, bidId suave.BidId, key string) ([]byte, error) { bid, err := suaveContext.Backend.ConfidentialStore.FetchBidById(bidId) if err != nil { return nil, suave.ErrBidNotFound } - caller, err := checkIsPrecompileCallAllowed(suaveContext, confStoreRetrieveAddress, bid) + caller, err := checkIsPrecompileCallAllowed(suaveContext, confRetrieveAddress, bid) if err != nil { return nil, err } @@ -336,12 +336,12 @@ func (b *suaveRuntime) confidentialInputs() ([]byte, error) { return (&confidentialInputsPrecompile{}).RunConfidential(b.suaveContext, nil) } -func (b *suaveRuntime) confidentialStoreRetrieve(bidId types.BidId, key string) ([]byte, error) { - return (&confStoreRetrieve{}).runImpl(b.suaveContext, bidId, key) +func (b *suaveRuntime) confidentialRetrieve(bidId types.BidId, key string) ([]byte, error) { + return (&confRetrieve{}).runImpl(b.suaveContext, bidId, key) } -func (b *suaveRuntime) confidentialStoreStore(bidId types.BidId, key string, data []byte) error { - return (&confStoreStore{}).runImpl(b.suaveContext, bidId, key, data) +func (b *suaveRuntime) confidentialStore(bidId types.BidId, key string, data []byte) error { + return (&confStore{}).runImpl(b.suaveContext, bidId, key, data) } func (b *suaveRuntime) signEthTransaction(txn []byte, chainId string, signingKey string) ([]byte, error) { diff --git a/core/vm/contracts_suave_eth.go b/core/vm/contracts_suave_eth.go index efd4ea1943..88950f2bf5 100644 --- a/core/vm/contracts_suave_eth.go +++ b/core/vm/contracts_suave_eth.go @@ -620,7 +620,7 @@ func (c *fillMevShareBundle) runImpl(suaveContext *SuaveContext, bidId types.Bid return nil, err } - matchedBundleIdsBytes, err := (&confStoreRetrieve{}).runImpl(suaveContext, bidId, "mevshare:v0:mergedBids") + matchedBundleIdsBytes, err := (&confRetrieve{}).runImpl(suaveContext, bidId, "mevshare:v0:mergedBids") if err != nil { return nil, err } @@ -632,7 +632,7 @@ func (c *fillMevShareBundle) runImpl(suaveContext *SuaveContext, bidId types.Bid matchBidIds := unpackedBidIds[0].([][16]byte) - userBundleBytes, err := (&confStoreRetrieve{}).runImpl(suaveContext, matchBidIds[0], "mevshare:v0:ethBundles") + userBundleBytes, err := (&confRetrieve{}).runImpl(suaveContext, matchBidIds[0], "mevshare:v0:ethBundles") if err != nil { return nil, fmt.Errorf("could not retrieve bundle data for bidId %v: %w", matchBidIds[0], err) } @@ -642,7 +642,7 @@ func (c *fillMevShareBundle) runImpl(suaveContext *SuaveContext, bidId types.Bid return nil, fmt.Errorf("could not unmarshal user bundle data for bidId %v: %w", matchBidIds[0], err) } - matchBundleBytes, err := (&confStoreRetrieve{}).runImpl(suaveContext, matchBidIds[1], "mevshare:v0:ethBundles") + matchBundleBytes, err := (&confRetrieve{}).runImpl(suaveContext, matchBidIds[1], "mevshare:v0:ethBundles") if err != nil { return nil, fmt.Errorf("could not retrieve match bundle data for bidId %v: %w", matchBidIds[1], err) } diff --git a/core/vm/contracts_suave_runtime_adapter.go b/core/vm/contracts_suave_runtime_adapter.go index 359216a046..6a265d2fb2 100644 --- a/core/vm/contracts_suave_runtime_adapter.go +++ b/core/vm/contracts_suave_runtime_adapter.go @@ -19,8 +19,8 @@ var ( type SuaveRuntime interface { buildEthBlock(blockArgs types.BuildBlockArgs, bidId types.BidId, namespace string) ([]byte, []byte, error) confidentialInputs() ([]byte, error) - confidentialStoreRetrieve(bidId types.BidId, key string) ([]byte, error) - confidentialStoreStore(bidId types.BidId, key string, data1 []byte) error + confidentialRetrieve(bidId types.BidId, key string) ([]byte, error) + confidentialStore(bidId types.BidId, key string, data1 []byte) error ethcall(contractAddr common.Address, input1 []byte) ([]byte, error) extractHint(bundleData []byte) ([]byte, error) fetchBids(cond uint64, namespace string) ([]types.Bid, error) @@ -35,8 +35,8 @@ type SuaveRuntime interface { var ( buildEthBlockAddr = common.HexToAddress("0x0000000000000000000000000000000042100001") confidentialInputsAddr = common.HexToAddress("0x0000000000000000000000000000000042010001") - confidentialStoreRetrieveAddr = common.HexToAddress("0x0000000000000000000000000000000042020001") - confidentialStoreStoreAddr = common.HexToAddress("0x0000000000000000000000000000000042020000") + confidentialRetrieveAddr = common.HexToAddress("0x0000000000000000000000000000000042020001") + confidentialStoreAddr = common.HexToAddress("0x0000000000000000000000000000000042020000") ethcallAddr = common.HexToAddress("0x0000000000000000000000000000000042100003") extractHintAddr = common.HexToAddress("0x0000000000000000000000000000000042100037") fetchBidsAddr = common.HexToAddress("0x0000000000000000000000000000000042030001") @@ -60,11 +60,11 @@ func (b *SuaveRuntimeAdapter) run(addr common.Address, input []byte) ([]byte, er case confidentialInputsAddr: return b.confidentialInputs(input) - case confidentialStoreRetrieveAddr: - return b.confidentialStoreRetrieve(input) + case confidentialRetrieveAddr: + return b.confidentialRetrieve(input) - case confidentialStoreStoreAddr: - return b.confidentialStoreStore(input) + case confidentialStoreAddr: + return b.confidentialStore(input) case ethcallAddr: return b.ethcall(input) @@ -179,7 +179,7 @@ func (b *SuaveRuntimeAdapter) confidentialInputs(input []byte) (res []byte, err } -func (b *SuaveRuntimeAdapter) confidentialStoreRetrieve(input []byte) (res []byte, err error) { +func (b *SuaveRuntimeAdapter) confidentialRetrieve(input []byte) (res []byte, err error) { var ( unpacked []interface{} result []byte @@ -188,7 +188,7 @@ func (b *SuaveRuntimeAdapter) confidentialStoreRetrieve(input []byte) (res []byt _ = unpacked _ = result - unpacked, err = artifacts.SuaveAbi.Methods["confidentialStoreRetrieve"].Inputs.Unpack(input) + unpacked, err = artifacts.SuaveAbi.Methods["confidentialRetrieve"].Inputs.Unpack(input) if err != nil { err = errFailedToUnpackInput return @@ -210,7 +210,7 @@ func (b *SuaveRuntimeAdapter) confidentialStoreRetrieve(input []byte) (res []byt output1 []byte ) - if output1, err = b.impl.confidentialStoreRetrieve(bidId, key); err != nil { + if output1, err = b.impl.confidentialRetrieve(bidId, key); err != nil { return } @@ -219,7 +219,7 @@ func (b *SuaveRuntimeAdapter) confidentialStoreRetrieve(input []byte) (res []byt } -func (b *SuaveRuntimeAdapter) confidentialStoreStore(input []byte) (res []byte, err error) { +func (b *SuaveRuntimeAdapter) confidentialStore(input []byte) (res []byte, err error) { var ( unpacked []interface{} result []byte @@ -228,7 +228,7 @@ func (b *SuaveRuntimeAdapter) confidentialStoreStore(input []byte) (res []byte, _ = unpacked _ = result - unpacked, err = artifacts.SuaveAbi.Methods["confidentialStoreStore"].Inputs.Unpack(input) + unpacked, err = artifacts.SuaveAbi.Methods["confidentialStore"].Inputs.Unpack(input) if err != nil { err = errFailedToUnpackInput return @@ -250,7 +250,7 @@ func (b *SuaveRuntimeAdapter) confidentialStoreStore(input []byte) (res []byte, var () - if err = b.impl.confidentialStoreStore(bidId, key, data1); err != nil { + if err = b.impl.confidentialStore(bidId, key, data1); err != nil { return } diff --git a/core/vm/contracts_suave_test.go b/core/vm/contracts_suave_test.go index fa817c6ad5..6de2de3b2f 100644 --- a/core/vm/contracts_suave_test.go +++ b/core/vm/contracts_suave_test.go @@ -118,9 +118,9 @@ func TestSuavePrecompileStub(t *testing.T) { // error in 'buildEthBlock' when it expects to retrieve bids in abi format from the // confidential store. "could not unpack merged bid ids", - "no caller of confidentialStoreRetrieve (0000000000000000000000000000000042020001) is allowed on 00000000000000000000000000000000", + "no caller of confidentialRetrieve (0000000000000000000000000000000042020001) is allowed on 00000000000000000000000000000000", "precompile fillMevShareBundle (0000000000000000000000000000000043200001) not allowed on 00000000000000000000000000000000", - "no caller of confidentialStoreStore (0000000000000000000000000000000042020000) is allowed on 00000000000000000000000000000000", + "no caller of confidentialStore (0000000000000000000000000000000042020000) is allowed on 00000000000000000000000000000000", "precompile buildEthBlock (0000000000000000000000000000000042100001) not allowed on 00000000000000000000000000000000", } @@ -229,27 +229,27 @@ func TestSuave_ConfStoreWorkflow(t *testing.T) { data := []byte{0x1} // cannot store a value for a bid that does not exist - err := b.confidentialStoreStore(types.BidId{}, "key", data) + err := b.confidentialStore(types.BidId{}, "key", data) require.Error(t, err) bid, err := b.newBid(5, []common.Address{callerAddr}, nil, "a") require.NoError(t, err) // cannot store the bid if the caller is not allowed to - err = b.confidentialStoreStore(bid.Id, "key", data) + err = b.confidentialStore(bid.Id, "key", data) require.Error(t, err) // now, the caller is allowed to store the bid b.suaveContext.CallerStack = append(b.suaveContext.CallerStack, &callerAddr) - err = b.confidentialStoreStore(bid.Id, "key", data) + err = b.confidentialStore(bid.Id, "key", data) require.NoError(t, err) - val, err := b.confidentialStoreRetrieve(bid.Id, "key") + val, err := b.confidentialRetrieve(bid.Id, "key") require.NoError(t, err) require.Equal(t, data, val) // cannot retrieve the value if the caller is not allowed to b.suaveContext.CallerStack = []*common.Address{} - _, err = b.confidentialStoreRetrieve(bid.Id, "key") + _, err = b.confidentialRetrieve(bid.Id, "key") require.Error(t, err) } diff --git a/core/vm/suave.go b/core/vm/suave.go index 96413bb3cd..cd7d9a9b89 100644 --- a/core/vm/suave.go +++ b/core/vm/suave.go @@ -117,7 +117,7 @@ func checkIsPrecompileCallAllowed(suaveContext *SuaveContext, precompile common. isPrecompileAllowed := slices.Contains(bid.AllowedPeekers, precompile) // Special case for confStore as those are implicitly allowed - if !isPrecompileAllowed && precompile != confStoreStoreAddress && precompile != confStoreRetrieveAddress { + if !isPrecompileAllowed && precompile != confStoreAddress && precompile != confRetrieveAddress { return common.Address{}, fmt.Errorf("precompile %s (%x) not allowed on %x", artifacts.PrecompileAddressToName(precompile), precompile, bid.Id) } diff --git a/suave/artifacts/Suave.sol/Suave.json b/suave/artifacts/Suave.sol/Suave.json index 1bb8dd8f07..668818c6f6 100644 --- a/suave/artifacts/Suave.sol/Suave.json +++ b/suave/artifacts/Suave.sol/Suave.json @@ -44,7 +44,7 @@ }, { "inputs": [], - "name": "CONFIDENTIAL_STORE_RETRIEVE", + "name": "CONFIDENTIAL_RETRIEVE", "outputs": [ { "internalType": "address", @@ -57,7 +57,7 @@ }, { "inputs": [], - "name": "CONFIDENTIAL_STORE_STORE", + "name": "CONFIDENTIAL_STORE", "outputs": [ { "internalType": "address", @@ -200,9 +200,9 @@ } ], "deployedBytecode": { - "object": "0x73000000000000000000000000000000000000000030146080604052600436106100f45760003560e01c8063b61b127d11610096578063c91e11df11610070578063c91e11df14610183578063d91525db1461018e578063f0608b1c14610199578063f6ab3de5146101a457600080fd5b8063b61b127d14610162578063b7817da01461016d578063bc50c0051461017857600080fd5b80637320cb17116100d25780637320cb1714610136578063744795b914610141578063751afe2c1461014c57806394804c691461015757600080fd5b806301c19530146100f9578063040e51831461012057806369094cbc1461012b575b600080fd5b610104634320000181565b6040516001600160a01b03909116815260200160405180910390f35b610104634210000381565b610104634201000181565b610104634203000081565b610104634010000181565b610104634210003781565b610104634210000181565b610104634210000081565b610104634202000081565b610104634210000281565b610104634203000181565b610104634201000081565b610104634300000181565b61010463420200018156fea164736f6c6343000813000a" + "object": "0x73000000000000000000000000000000000000000030146080604052600436106100f45760003560e01c8063ad05aae411610096578063c91e11df11610070578063c91e11df14610183578063d91525db1461018e578063f057975914610199578063f0608b1c146101a457600080fd5b8063ad05aae414610162578063b61b127d1461016d578063bc50c0051461017857600080fd5b80637320cb17116100d25780637320cb1714610136578063744795b914610141578063751afe2c1461014c57806394804c691461015757600080fd5b806301c19530146100f9578063040e51831461012057806369094cbc1461012b575b600080fd5b610104634320000181565b6040516001600160a01b03909116815260200160405180910390f35b610104634210000381565b610104634201000181565b610104634203000081565b610104634010000181565b610104634210003781565b610104634210000181565b610104634202000081565b610104634210000081565b610104634210000281565b610104634203000181565b610104634201000081565b610104634202000181565b61010463430000018156fea164736f6c6343000813000a" }, "bytecode": { - "object": "0x6101bc61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100f45760003560e01c8063b61b127d11610096578063c91e11df11610070578063c91e11df14610183578063d91525db1461018e578063f0608b1c14610199578063f6ab3de5146101a457600080fd5b8063b61b127d14610162578063b7817da01461016d578063bc50c0051461017857600080fd5b80637320cb17116100d25780637320cb1714610136578063744795b914610141578063751afe2c1461014c57806394804c691461015757600080fd5b806301c19530146100f9578063040e51831461012057806369094cbc1461012b575b600080fd5b610104634320000181565b6040516001600160a01b03909116815260200160405180910390f35b610104634210000381565b610104634201000181565b610104634203000081565b610104634010000181565b610104634210003781565b610104634210000181565b610104634210000081565b610104634202000081565b610104634210000281565b610104634203000181565b610104634201000081565b610104634300000181565b61010463420200018156fea164736f6c6343000813000a" + "object": "0x6101bc61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100f45760003560e01c8063ad05aae411610096578063c91e11df11610070578063c91e11df14610183578063d91525db1461018e578063f057975914610199578063f0608b1c146101a457600080fd5b8063ad05aae414610162578063b61b127d1461016d578063bc50c0051461017857600080fd5b80637320cb17116100d25780637320cb1714610136578063744795b914610141578063751afe2c1461014c57806394804c691461015757600080fd5b806301c19530146100f9578063040e51831461012057806369094cbc1461012b575b600080fd5b610104634320000181565b6040516001600160a01b03909116815260200160405180910390f35b610104634210000381565b610104634201000181565b610104634203000081565b610104634010000181565b610104634210003781565b610104634210000181565b610104634202000081565b610104634210000081565b610104634210000281565b610104634203000181565b610104634201000081565b610104634202000181565b61010463430000018156fea164736f6c6343000813000a" } } diff --git a/suave/artifacts/SuaveAbi.sol/SuaveAbi.json b/suave/artifacts/SuaveAbi.sol/SuaveAbi.json index 848a77b5c7..5e8b711f4c 100644 --- a/suave/artifacts/SuaveAbi.sol/SuaveAbi.json +++ b/suave/artifacts/SuaveAbi.sol/SuaveAbi.json @@ -127,7 +127,7 @@ "type": "string" } ], - "name": "confidentialStoreRetrieve", + "name": "confidentialRetrieve", "outputs": [ { "internalType": "bytes", @@ -156,7 +156,7 @@ "type": "bytes" } ], - "name": "confidentialStoreStore", + "name": "confidentialStore", "outputs": [], "stateMutability": "view", "type": "function" @@ -424,9 +424,9 @@ } ], "deployedBytecode": { - "object": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806392649e7d1161007157806392649e7d14610144578063a90a6c5f1461015b578063ae9a604014610170578063b2c1714c1461017e578063bd5bcdf314610199578063fb4f1e0d1461014457600080fd5b8063023e8e2f146100ae57806320f16c3e146100df57806337a5686a146101005780634f563141146101165780638735d61714610136575b600080fd5b6100c26100bc3660046102fa565b50600090565b6040516001600160401b0390911681526020015b60405180910390f35b6100f36100ed3660046102fa565b50606090565b6040516100d69190610374565b6100f361010e36600461038e565b606092915050565b6101296101243660046104b9565b6101c0565b6040516100d69190610624565b6100f36100ed366004610658565b6100f3610152366004610673565b60609392505050565b61016e6101693660046106fa565b505050565b005b6100f361010e366004610734565b61018c61010e366004610777565b6040516100d69190610793565b6101b26101a73660046108a4565b606080935093915050565b6040516100d6929190610995565b6040805160c0810182526000808252602082018190529181019190915260608082018190526080820181905260a08201525b949350505050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715610232576102326101fa565b60405290565b60405161010081016001600160401b0381118282101715610232576102326101fa565b604051601f8201601f191681016001600160401b0381118282101715610283576102836101fa565b604052919050565b600082601f83011261029c57600080fd5b81356001600160401b038111156102b5576102b56101fa565b6102c8601f8201601f191660200161025b565b8181528460208386010111156102dd57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561030c57600080fd5b81356001600160401b0381111561032257600080fd5b6101f28482850161028b565b6000815180845260005b8181101561035457602081850181015186830182015201610338565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610387602083018461032e565b9392505050565b600080604083850312156103a157600080fd5b82356001600160401b03808211156103b857600080fd5b6103c48683870161028b565b935060208501359150808211156103da57600080fd5b506103e78582860161028b565b9150509250929050565b80356001600160401b038116811461040857600080fd5b919050565b60006001600160401b03821115610426576104266101fa565b5060051b60200190565b80356001600160a01b038116811461040857600080fd5b600082601f83011261045857600080fd5b8135602061046d6104688361040d565b61025b565b82815260059290921b8401810191818101908684111561048c57600080fd5b8286015b848110156104ae576104a181610430565b8352918301918301610490565b509695505050505050565b600080600080608085870312156104cf57600080fd5b6104d8856103f1565b935060208501356001600160401b03808211156104f457600080fd5b61050088838901610447565b9450604087013591508082111561051657600080fd5b61052288838901610447565b9350606087013591508082111561053857600080fd5b506105458782880161028b565b91505092959194509250565b600081518084526020808501945080840160005b8381101561058a5781516001600160a01b031687529582019590820190600101610565565b509495945050505050565b60006fffffffffffffffffffffffffffffffff19808351168452806020840151166020850152506001600160401b036040830151166040840152606082015160c060608501526105e860c0850182610551565b9050608083015184820360808601526106018282610551565b91505060a083015184820360a086015261061b828261032e565b95945050505050565b6020815260006103876020830184610595565b80356fffffffffffffffffffffffffffffffff198116811461040857600080fd5b60006020828403121561066a57600080fd5b61038782610637565b60008060006060848603121561068857600080fd5b83356001600160401b038082111561069f57600080fd5b6106ab8783880161028b565b945060208601359150808211156106c157600080fd5b6106cd8783880161028b565b935060408601359150808211156106e357600080fd5b506106f08682870161028b565b9150509250925092565b60008060006060848603121561070f57600080fd5b61071884610637565b925060208401356001600160401b03808211156106c157600080fd5b6000806040838503121561074757600080fd5b61075083610637565b915060208301356001600160401b0381111561076b57600080fd5b6103e78582860161028b565b6000806040838503121561078a57600080fd5b610750836103f1565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156107e857603f198886030184526107d6858351610595565b945092850192908501906001016107ba565b5092979650505050505050565b600082601f83011261080657600080fd5b813560206108166104688361040d565b82815260079290921b8401810191818101908684111561083557600080fd5b8286015b848110156104ae57608081890312156108525760008081fd5b61085a610210565b610863826103f1565b81526108708583016103f1565b858201526040610881818401610430565b9082015260606108928382016103f1565b90820152835291830191608001610839565b6000806000606084860312156108b957600080fd5b83356001600160401b03808211156108d057600080fd5b9085019061010082880312156108e557600080fd5b6108ed610238565b6108f6836103f1565b815260208301358281111561090a57600080fd5b6109168982860161028b565b60208301525060408301356040820152610932606084016103f1565b606082015261094360808401610430565b608082015261095460a084016103f1565b60a082015260c083013560c082015260e08301358281111561097557600080fd5b610981898286016107f5565b60e08301525094506106cd60208701610637565b6040815260006109a8604083018561032e565b828103602084015261061b818561032e56fea164736f6c6343000813000a" + "object": "0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806392649e7d1161007157806392649e7d14610144578063b2c1714c1461015b578063bd5bcdf314610176578063d22a3b0b1461019d578063e3b417bc146101b2578063fb4f1e0d1461014457600080fd5b8063023e8e2f146100ae57806320f16c3e146100df57806337a5686a146101005780634f563141146101165780638735d61714610136575b600080fd5b6100c26100bc3660046102fa565b50600090565b6040516001600160401b0390911681526020015b60405180910390f35b6100f36100ed3660046102fa565b50606090565b6040516100d69190610374565b6100f361010e36600461038e565b606092915050565b6101296101243660046104b9565b6101c0565b6040516100d69190610624565b6100f36100ed366004610658565b6100f3610152366004610673565b60609392505050565b61016961010e3660046106fa565b6040516100d6919061073d565b61018f61018436600461084e565b606080935093915050565b6040516100d692919061093f565b6101b06101ab366004610964565b505050565b005b6100f361010e36600461099e565b6040805160c0810182526000808252602082018190529181019190915260608082018190526080820181905260a08201525b949350505050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715610232576102326101fa565b60405290565b60405161010081016001600160401b0381118282101715610232576102326101fa565b604051601f8201601f191681016001600160401b0381118282101715610283576102836101fa565b604052919050565b600082601f83011261029c57600080fd5b81356001600160401b038111156102b5576102b56101fa565b6102c8601f8201601f191660200161025b565b8181528460208386010111156102dd57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561030c57600080fd5b81356001600160401b0381111561032257600080fd5b6101f28482850161028b565b6000815180845260005b8181101561035457602081850181015186830182015201610338565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610387602083018461032e565b9392505050565b600080604083850312156103a157600080fd5b82356001600160401b03808211156103b857600080fd5b6103c48683870161028b565b935060208501359150808211156103da57600080fd5b506103e78582860161028b565b9150509250929050565b80356001600160401b038116811461040857600080fd5b919050565b60006001600160401b03821115610426576104266101fa565b5060051b60200190565b80356001600160a01b038116811461040857600080fd5b600082601f83011261045857600080fd5b8135602061046d6104688361040d565b61025b565b82815260059290921b8401810191818101908684111561048c57600080fd5b8286015b848110156104ae576104a181610430565b8352918301918301610490565b509695505050505050565b600080600080608085870312156104cf57600080fd5b6104d8856103f1565b935060208501356001600160401b03808211156104f457600080fd5b61050088838901610447565b9450604087013591508082111561051657600080fd5b61052288838901610447565b9350606087013591508082111561053857600080fd5b506105458782880161028b565b91505092959194509250565b600081518084526020808501945080840160005b8381101561058a5781516001600160a01b031687529582019590820190600101610565565b509495945050505050565b60006fffffffffffffffffffffffffffffffff19808351168452806020840151166020850152506001600160401b036040830151166040840152606082015160c060608501526105e860c0850182610551565b9050608083015184820360808601526106018282610551565b91505060a083015184820360a086015261061b828261032e565b95945050505050565b6020815260006103876020830184610595565b80356fffffffffffffffffffffffffffffffff198116811461040857600080fd5b60006020828403121561066a57600080fd5b61038782610637565b60008060006060848603121561068857600080fd5b83356001600160401b038082111561069f57600080fd5b6106ab8783880161028b565b945060208601359150808211156106c157600080fd5b6106cd8783880161028b565b935060408601359150808211156106e357600080fd5b506106f08682870161028b565b9150509250925092565b6000806040838503121561070d57600080fd5b610716836103f1565b915060208301356001600160401b0381111561073157600080fd5b6103e78582860161028b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561079257603f19888603018452610780858351610595565b94509285019290850190600101610764565b5092979650505050505050565b600082601f8301126107b057600080fd5b813560206107c06104688361040d565b82815260079290921b840181019181810190868411156107df57600080fd5b8286015b848110156104ae57608081890312156107fc5760008081fd5b610804610210565b61080d826103f1565b815261081a8583016103f1565b85820152604061082b818401610430565b90820152606061083c8382016103f1565b908201528352918301916080016107e3565b60008060006060848603121561086357600080fd5b83356001600160401b038082111561087a57600080fd5b90850190610100828803121561088f57600080fd5b610897610238565b6108a0836103f1565b81526020830135828111156108b457600080fd5b6108c08982860161028b565b602083015250604083013560408201526108dc606084016103f1565b60608201526108ed60808401610430565b60808201526108fe60a084016103f1565b60a082015260c083013560c082015260e08301358281111561091f57600080fd5b61092b8982860161079f565b60e08301525094506106cd60208701610637565b604081526000610952604083018561032e565b828103602084015261061b818561032e565b60008060006060848603121561097957600080fd5b61098284610637565b925060208401356001600160401b03808211156106c157600080fd5b600080604083850312156109b157600080fd5b6107168361063756fea164736f6c6343000813000a" }, "bytecode": { - "object": "0x608060405234801561001057600080fd5b506109c7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806392649e7d1161007157806392649e7d14610144578063a90a6c5f1461015b578063ae9a604014610170578063b2c1714c1461017e578063bd5bcdf314610199578063fb4f1e0d1461014457600080fd5b8063023e8e2f146100ae57806320f16c3e146100df57806337a5686a146101005780634f563141146101165780638735d61714610136575b600080fd5b6100c26100bc3660046102fa565b50600090565b6040516001600160401b0390911681526020015b60405180910390f35b6100f36100ed3660046102fa565b50606090565b6040516100d69190610374565b6100f361010e36600461038e565b606092915050565b6101296101243660046104b9565b6101c0565b6040516100d69190610624565b6100f36100ed366004610658565b6100f3610152366004610673565b60609392505050565b61016e6101693660046106fa565b505050565b005b6100f361010e366004610734565b61018c61010e366004610777565b6040516100d69190610793565b6101b26101a73660046108a4565b606080935093915050565b6040516100d6929190610995565b6040805160c0810182526000808252602082018190529181019190915260608082018190526080820181905260a08201525b949350505050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715610232576102326101fa565b60405290565b60405161010081016001600160401b0381118282101715610232576102326101fa565b604051601f8201601f191681016001600160401b0381118282101715610283576102836101fa565b604052919050565b600082601f83011261029c57600080fd5b81356001600160401b038111156102b5576102b56101fa565b6102c8601f8201601f191660200161025b565b8181528460208386010111156102dd57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561030c57600080fd5b81356001600160401b0381111561032257600080fd5b6101f28482850161028b565b6000815180845260005b8181101561035457602081850181015186830182015201610338565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610387602083018461032e565b9392505050565b600080604083850312156103a157600080fd5b82356001600160401b03808211156103b857600080fd5b6103c48683870161028b565b935060208501359150808211156103da57600080fd5b506103e78582860161028b565b9150509250929050565b80356001600160401b038116811461040857600080fd5b919050565b60006001600160401b03821115610426576104266101fa565b5060051b60200190565b80356001600160a01b038116811461040857600080fd5b600082601f83011261045857600080fd5b8135602061046d6104688361040d565b61025b565b82815260059290921b8401810191818101908684111561048c57600080fd5b8286015b848110156104ae576104a181610430565b8352918301918301610490565b509695505050505050565b600080600080608085870312156104cf57600080fd5b6104d8856103f1565b935060208501356001600160401b03808211156104f457600080fd5b61050088838901610447565b9450604087013591508082111561051657600080fd5b61052288838901610447565b9350606087013591508082111561053857600080fd5b506105458782880161028b565b91505092959194509250565b600081518084526020808501945080840160005b8381101561058a5781516001600160a01b031687529582019590820190600101610565565b509495945050505050565b60006fffffffffffffffffffffffffffffffff19808351168452806020840151166020850152506001600160401b036040830151166040840152606082015160c060608501526105e860c0850182610551565b9050608083015184820360808601526106018282610551565b91505060a083015184820360a086015261061b828261032e565b95945050505050565b6020815260006103876020830184610595565b80356fffffffffffffffffffffffffffffffff198116811461040857600080fd5b60006020828403121561066a57600080fd5b61038782610637565b60008060006060848603121561068857600080fd5b83356001600160401b038082111561069f57600080fd5b6106ab8783880161028b565b945060208601359150808211156106c157600080fd5b6106cd8783880161028b565b935060408601359150808211156106e357600080fd5b506106f08682870161028b565b9150509250925092565b60008060006060848603121561070f57600080fd5b61071884610637565b925060208401356001600160401b03808211156106c157600080fd5b6000806040838503121561074757600080fd5b61075083610637565b915060208301356001600160401b0381111561076b57600080fd5b6103e78582860161028b565b6000806040838503121561078a57600080fd5b610750836103f1565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156107e857603f198886030184526107d6858351610595565b945092850192908501906001016107ba565b5092979650505050505050565b600082601f83011261080657600080fd5b813560206108166104688361040d565b82815260079290921b8401810191818101908684111561083557600080fd5b8286015b848110156104ae57608081890312156108525760008081fd5b61085a610210565b610863826103f1565b81526108708583016103f1565b858201526040610881818401610430565b9082015260606108928382016103f1565b90820152835291830191608001610839565b6000806000606084860312156108b957600080fd5b83356001600160401b03808211156108d057600080fd5b9085019061010082880312156108e557600080fd5b6108ed610238565b6108f6836103f1565b815260208301358281111561090a57600080fd5b6109168982860161028b565b60208301525060408301356040820152610932606084016103f1565b606082015261094360808401610430565b608082015261095460a084016103f1565b60a082015260c083013560c082015260e08301358281111561097557600080fd5b610981898286016107f5565b60e08301525094506106cd60208701610637565b6040815260006109a8604083018561032e565b828103602084015261061b818561032e56fea164736f6c6343000813000a" + "object": "0x608060405234801561001057600080fd5b506109c7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806392649e7d1161007157806392649e7d14610144578063b2c1714c1461015b578063bd5bcdf314610176578063d22a3b0b1461019d578063e3b417bc146101b2578063fb4f1e0d1461014457600080fd5b8063023e8e2f146100ae57806320f16c3e146100df57806337a5686a146101005780634f563141146101165780638735d61714610136575b600080fd5b6100c26100bc3660046102fa565b50600090565b6040516001600160401b0390911681526020015b60405180910390f35b6100f36100ed3660046102fa565b50606090565b6040516100d69190610374565b6100f361010e36600461038e565b606092915050565b6101296101243660046104b9565b6101c0565b6040516100d69190610624565b6100f36100ed366004610658565b6100f3610152366004610673565b60609392505050565b61016961010e3660046106fa565b6040516100d6919061073d565b61018f61018436600461084e565b606080935093915050565b6040516100d692919061093f565b6101b06101ab366004610964565b505050565b005b6100f361010e36600461099e565b6040805160c0810182526000808252602082018190529181019190915260608082018190526080820181905260a08201525b949350505050565b634e487b7160e01b600052604160045260246000fd5b604051608081016001600160401b0381118282101715610232576102326101fa565b60405290565b60405161010081016001600160401b0381118282101715610232576102326101fa565b604051601f8201601f191681016001600160401b0381118282101715610283576102836101fa565b604052919050565b600082601f83011261029c57600080fd5b81356001600160401b038111156102b5576102b56101fa565b6102c8601f8201601f191660200161025b565b8181528460208386010111156102dd57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561030c57600080fd5b81356001600160401b0381111561032257600080fd5b6101f28482850161028b565b6000815180845260005b8181101561035457602081850181015186830182015201610338565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000610387602083018461032e565b9392505050565b600080604083850312156103a157600080fd5b82356001600160401b03808211156103b857600080fd5b6103c48683870161028b565b935060208501359150808211156103da57600080fd5b506103e78582860161028b565b9150509250929050565b80356001600160401b038116811461040857600080fd5b919050565b60006001600160401b03821115610426576104266101fa565b5060051b60200190565b80356001600160a01b038116811461040857600080fd5b600082601f83011261045857600080fd5b8135602061046d6104688361040d565b61025b565b82815260059290921b8401810191818101908684111561048c57600080fd5b8286015b848110156104ae576104a181610430565b8352918301918301610490565b509695505050505050565b600080600080608085870312156104cf57600080fd5b6104d8856103f1565b935060208501356001600160401b03808211156104f457600080fd5b61050088838901610447565b9450604087013591508082111561051657600080fd5b61052288838901610447565b9350606087013591508082111561053857600080fd5b506105458782880161028b565b91505092959194509250565b600081518084526020808501945080840160005b8381101561058a5781516001600160a01b031687529582019590820190600101610565565b509495945050505050565b60006fffffffffffffffffffffffffffffffff19808351168452806020840151166020850152506001600160401b036040830151166040840152606082015160c060608501526105e860c0850182610551565b9050608083015184820360808601526106018282610551565b91505060a083015184820360a086015261061b828261032e565b95945050505050565b6020815260006103876020830184610595565b80356fffffffffffffffffffffffffffffffff198116811461040857600080fd5b60006020828403121561066a57600080fd5b61038782610637565b60008060006060848603121561068857600080fd5b83356001600160401b038082111561069f57600080fd5b6106ab8783880161028b565b945060208601359150808211156106c157600080fd5b6106cd8783880161028b565b935060408601359150808211156106e357600080fd5b506106f08682870161028b565b9150509250925092565b6000806040838503121561070d57600080fd5b610716836103f1565b915060208301356001600160401b0381111561073157600080fd5b6103e78582860161028b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561079257603f19888603018452610780858351610595565b94509285019290850190600101610764565b5092979650505050505050565b600082601f8301126107b057600080fd5b813560206107c06104688361040d565b82815260079290921b840181019181810190868411156107df57600080fd5b8286015b848110156104ae57608081890312156107fc5760008081fd5b610804610210565b61080d826103f1565b815261081a8583016103f1565b85820152604061082b818401610430565b90820152606061083c8382016103f1565b908201528352918301916080016107e3565b60008060006060848603121561086357600080fd5b83356001600160401b038082111561087a57600080fd5b90850190610100828803121561088f57600080fd5b610897610238565b6108a0836103f1565b81526020830135828111156108b457600080fd5b6108c08982860161028b565b602083015250604083013560408201526108dc606084016103f1565b60608201526108ed60808401610430565b60808201526108fe60a084016103f1565b60a082015260c083013560c082015260e08301358281111561091f57600080fd5b61092b8982860161079f565b60e08301525094506106cd60208701610637565b604081526000610952604083018561032e565b828103602084015261061b818561032e565b60008060006060848603121561097957600080fd5b61098284610637565b925060208401356001600160401b03808211156106c157600080fd5b600080604083850312156109b157600080fd5b6107168361063756fea164736f6c6343000813000a" } } diff --git a/suave/artifacts/SuaveLib.json b/suave/artifacts/SuaveLib.json index b2dd7839fd..96c83d449b 100644 --- a/suave/artifacts/SuaveLib.json +++ b/suave/artifacts/SuaveLib.json @@ -1 +1 @@ -[{"type":"function","name":"buildEthBlock","inputs":[{"name":"blockArgs","type":"tuple","internalType":"struct Suave.BuildBlockArgs","components":[{"name":"slot","type":"uint64","internalType":"uint64"},{"name":"proposerPubkey","type":"bytes","internalType":"bytes"},{"name":"parent","type":"bytes32","internalType":"bytes32"},{"name":"timestamp","type":"uint64","internalType":"uint64"},{"name":"feeRecipient","type":"address","internalType":"address"},{"name":"gasLimit","type":"uint64","internalType":"uint64"},{"name":"random","type":"bytes32","internalType":"bytes32"},{"name":"withdrawals","type":"tuple[]","internalType":"struct Suave.Withdrawal[]","components":[{"name":"index","type":"uint64","internalType":"uint64"},{"name":"validator","type":"uint64","internalType":"uint64"},{"name":"Address","type":"address","internalType":"address"},{"name":"amount","type":"uint64","internalType":"uint64"}]}]},{"name":"bidId","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"namespace","type":"string","internalType":"string"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"},{"name":"output2","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"confidentialInputs","outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"confidentialStoreRetrieve","inputs":[{"name":"bidId","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"key","type":"string","internalType":"string"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"confidentialStoreStore","inputs":[{"name":"bidId","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"key","type":"string","internalType":"string"},{"name":"data1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"ethcall","inputs":[{"name":"contractAddr","type":"address","internalType":"address"},{"name":"input1","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"extractHint","inputs":[{"name":"bundleData","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"fetchBids","inputs":[{"name":"cond","type":"uint64","internalType":"uint64"},{"name":"namespace","type":"string","internalType":"string"}],"outputs":[{"name":"bid","type":"tuple[]","internalType":"struct Suave.Bid[]","components":[{"name":"id","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"salt","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"decryptionCondition","type":"uint64","internalType":"uint64"},{"name":"allowedPeekers","type":"address[]","internalType":"address[]"},{"name":"allowedStores","type":"address[]","internalType":"address[]"},{"name":"version","type":"string","internalType":"string"}]}]},{"type":"function","name":"fillMevShareBundle","inputs":[{"name":"bidId","type":"bytes16","internalType":"struct Suave.BidId"}],"outputs":[{"name":"encodedBundle","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"newBid","inputs":[{"name":"decryptionCondition","type":"uint64","internalType":"uint64"},{"name":"allowedPeekers","type":"address[]","internalType":"address[]"},{"name":"allowedStores","type":"address[]","internalType":"address[]"},{"name":"bidType","type":"string","internalType":"string"}],"outputs":[{"name":"bid","type":"tuple","internalType":"struct Suave.Bid","components":[{"name":"id","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"salt","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"decryptionCondition","type":"uint64","internalType":"uint64"},{"name":"allowedPeekers","type":"address[]","internalType":"address[]"},{"name":"allowedStores","type":"address[]","internalType":"address[]"},{"name":"version","type":"string","internalType":"string"}]}]},{"type":"function","name":"signEthTransaction","inputs":[{"name":"txn","type":"bytes","internalType":"bytes"},{"name":"chainId","type":"string","internalType":"string"},{"name":"signingKey","type":"string","internalType":"string"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"simulateBundle","inputs":[{"name":"bundleData","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"output1","type":"uint64","internalType":"uint64"}]},{"type":"function","name":"submitBundleJsonRPC","inputs":[{"name":"url","type":"string","internalType":"string"},{"name":"method","type":"string","internalType":"string"},{"name":"params","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"submitEthBlockBidToRelay","inputs":[{"name":"relayUrl","type":"string","internalType":"string"},{"name":"builderBid","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]}] \ No newline at end of file +[{"type":"function","name":"buildEthBlock","inputs":[{"name":"blockArgs","type":"tuple","internalType":"struct Suave.BuildBlockArgs","components":[{"name":"slot","type":"uint64","internalType":"uint64"},{"name":"proposerPubkey","type":"bytes","internalType":"bytes"},{"name":"parent","type":"bytes32","internalType":"bytes32"},{"name":"timestamp","type":"uint64","internalType":"uint64"},{"name":"feeRecipient","type":"address","internalType":"address"},{"name":"gasLimit","type":"uint64","internalType":"uint64"},{"name":"random","type":"bytes32","internalType":"bytes32"},{"name":"withdrawals","type":"tuple[]","internalType":"struct Suave.Withdrawal[]","components":[{"name":"index","type":"uint64","internalType":"uint64"},{"name":"validator","type":"uint64","internalType":"uint64"},{"name":"Address","type":"address","internalType":"address"},{"name":"amount","type":"uint64","internalType":"uint64"}]}]},{"name":"bidId","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"namespace","type":"string","internalType":"string"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"},{"name":"output2","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"confidentialInputs","outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"confidentialRetrieve","inputs":[{"name":"bidId","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"key","type":"string","internalType":"string"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"confidentialStore","inputs":[{"name":"bidId","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"key","type":"string","internalType":"string"},{"name":"data1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"ethcall","inputs":[{"name":"contractAddr","type":"address","internalType":"address"},{"name":"input1","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"extractHint","inputs":[{"name":"bundleData","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"fetchBids","inputs":[{"name":"cond","type":"uint64","internalType":"uint64"},{"name":"namespace","type":"string","internalType":"string"}],"outputs":[{"name":"bid","type":"tuple[]","internalType":"struct Suave.Bid[]","components":[{"name":"id","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"salt","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"decryptionCondition","type":"uint64","internalType":"uint64"},{"name":"allowedPeekers","type":"address[]","internalType":"address[]"},{"name":"allowedStores","type":"address[]","internalType":"address[]"},{"name":"version","type":"string","internalType":"string"}]}]},{"type":"function","name":"fillMevShareBundle","inputs":[{"name":"bidId","type":"bytes16","internalType":"struct Suave.BidId"}],"outputs":[{"name":"encodedBundle","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"newBid","inputs":[{"name":"decryptionCondition","type":"uint64","internalType":"uint64"},{"name":"allowedPeekers","type":"address[]","internalType":"address[]"},{"name":"allowedStores","type":"address[]","internalType":"address[]"},{"name":"bidType","type":"string","internalType":"string"}],"outputs":[{"name":"bid","type":"tuple","internalType":"struct Suave.Bid","components":[{"name":"id","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"salt","type":"bytes16","internalType":"struct Suave.BidId"},{"name":"decryptionCondition","type":"uint64","internalType":"uint64"},{"name":"allowedPeekers","type":"address[]","internalType":"address[]"},{"name":"allowedStores","type":"address[]","internalType":"address[]"},{"name":"version","type":"string","internalType":"string"}]}]},{"type":"function","name":"signEthTransaction","inputs":[{"name":"txn","type":"bytes","internalType":"bytes"},{"name":"chainId","type":"string","internalType":"string"},{"name":"signingKey","type":"string","internalType":"string"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"simulateBundle","inputs":[{"name":"bundleData","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"output1","type":"uint64","internalType":"uint64"}]},{"type":"function","name":"submitBundleJsonRPC","inputs":[{"name":"url","type":"string","internalType":"string"},{"name":"method","type":"string","internalType":"string"},{"name":"params","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]},{"type":"function","name":"submitEthBlockBidToRelay","inputs":[{"name":"relayUrl","type":"string","internalType":"string"},{"name":"builderBid","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"output1","type":"bytes","internalType":"bytes"}]}] \ No newline at end of file diff --git a/suave/artifacts/addresses.go b/suave/artifacts/addresses.go index 3abe51d486..18ac750a68 100644 --- a/suave/artifacts/addresses.go +++ b/suave/artifacts/addresses.go @@ -10,8 +10,8 @@ import ( var ( buildEthBlockAddr = common.HexToAddress("0x0000000000000000000000000000000042100001") confidentialInputsAddr = common.HexToAddress("0x0000000000000000000000000000000042010001") - confidentialStoreRetrieveAddr = common.HexToAddress("0x0000000000000000000000000000000042020001") - confidentialStoreStoreAddr = common.HexToAddress("0x0000000000000000000000000000000042020000") + confidentialRetrieveAddr = common.HexToAddress("0x0000000000000000000000000000000042020001") + confidentialStoreAddr = common.HexToAddress("0x0000000000000000000000000000000042020000") ethcallAddr = common.HexToAddress("0x0000000000000000000000000000000042100003") extractHintAddr = common.HexToAddress("0x0000000000000000000000000000000042100037") fetchBidsAddr = common.HexToAddress("0x0000000000000000000000000000000042030001") @@ -26,8 +26,8 @@ var ( var SuaveMethods = map[string]common.Address{ "buildEthBlock": buildEthBlockAddr, "confidentialInputs": confidentialInputsAddr, - "confidentialStoreRetrieve": confidentialStoreRetrieveAddr, - "confidentialStoreStore": confidentialStoreStoreAddr, + "confidentialRetrieve": confidentialRetrieveAddr, + "confidentialStore": confidentialStoreAddr, "ethcall": ethcallAddr, "extractHint": extractHintAddr, "fetchBids": fetchBidsAddr, @@ -45,10 +45,10 @@ func PrecompileAddressToName(addr common.Address) string { return "buildEthBlock" case confidentialInputsAddr: return "confidentialInputs" - case confidentialStoreRetrieveAddr: - return "confidentialStoreRetrieve" - case confidentialStoreStoreAddr: - return "confidentialStoreStore" + case confidentialRetrieveAddr: + return "confidentialRetrieve" + case confidentialStoreAddr: + return "confidentialStore" case ethcallAddr: return "ethcall" case extractHintAddr: diff --git a/suave/e2e/workflow_test.go b/suave/e2e/workflow_test.go index 771ac591eb..c0ea4d6fd3 100644 --- a/suave/e2e/workflow_test.go +++ b/suave/e2e/workflow_test.go @@ -1047,7 +1047,7 @@ func TestE2E_ForgeIntegration(t *testing.T) { err = rpcClient.Call(&simResult, "eth_call", setTxArgsDefaults(callArgs), "latest") require.NoError(t, err) - if methodName == "confidentialStoreRetrieve" { + if methodName == "confidentialRetrieve" { // this method does not abi pack the output return []interface{}{[]byte(simResult)} } @@ -1070,9 +1070,9 @@ func TestE2E_ForgeIntegration(t *testing.T) { require.Equal(t, bids[0].Id, bid.Id) val := []byte{0x1, 0x2, 0x3} - doCall("confidentialStoreStore", bid.Id, "a", val) + doCall("confidentialStore", bid.Id, "a", val) - valRaw := doCall("confidentialStoreRetrieve", bid.Id, "a") + valRaw := doCall("confidentialRetrieve", bid.Id, "a") require.Equal(t, val, valRaw[0]) } diff --git a/suave/gen/main_test.go b/suave/gen/main_test.go index b8c1259d37..fd8056dcc0 100644 --- a/suave/gen/main_test.go +++ b/suave/gen/main_test.go @@ -12,7 +12,7 @@ func TestToAddressName(t *testing.T) { expected string }{ {"newBid", "NEW_BID"}, - {"confidentialStoreRetrieve", "CONFIDENTIAL_STORE_RETRIEVE"}, + {"confidentialRetrieve", "CONFIDENTIAL_RETRIEVE"}, } for _, c := range cases { diff --git a/suave/gen/suave_spec.yaml b/suave/gen/suave_spec.yaml index e60fc74434..1d35a3aa4f 100644 --- a/suave/gen/suave_spec.yaml +++ b/suave/gen/suave_spec.yaml @@ -78,7 +78,7 @@ functions: fields: - name: bid type: Bid[] - - name: confidentialStoreStore + - name: confidentialStore address: "0x0000000000000000000000000000000042020000" input: - name: bidId @@ -87,7 +87,7 @@ functions: type: string - name: data1 type: bytes - - name: confidentialStoreRetrieve + - name: confidentialRetrieve address: "0x0000000000000000000000000000000042020001" input: - name: bidId diff --git a/suave/sol/libraries/Suave.sol b/suave/sol/libraries/Suave.sol index 3923371d53..012b6884e9 100644 --- a/suave/sol/libraries/Suave.sol +++ b/suave/sol/libraries/Suave.sol @@ -39,9 +39,9 @@ library Suave { address public constant CONFIDENTIAL_INPUTS = 0x0000000000000000000000000000000042010001; - address public constant CONFIDENTIAL_STORE_RETRIEVE = 0x0000000000000000000000000000000042020001; + address public constant CONFIDENTIAL_RETRIEVE = 0x0000000000000000000000000000000042020001; - address public constant CONFIDENTIAL_STORE_STORE = 0x0000000000000000000000000000000042020000; + address public constant CONFIDENTIAL_STORE = 0x0000000000000000000000000000000042020000; address public constant ETHCALL = 0x0000000000000000000000000000000042100003; @@ -97,19 +97,19 @@ library Suave { return data; } - function confidentialStoreRetrieve(BidId bidId, string memory key) internal view returns (bytes memory) { - (bool success, bytes memory data) = CONFIDENTIAL_STORE_RETRIEVE.staticcall(abi.encode(bidId, key)); + function confidentialRetrieve(BidId bidId, string memory key) internal view returns (bytes memory) { + (bool success, bytes memory data) = CONFIDENTIAL_RETRIEVE.staticcall(abi.encode(bidId, key)); if (!success) { - revert PeekerReverted(CONFIDENTIAL_STORE_RETRIEVE, data); + revert PeekerReverted(CONFIDENTIAL_RETRIEVE, data); } return data; } - function confidentialStoreStore(BidId bidId, string memory key, bytes memory data1) internal view { - (bool success, bytes memory data) = CONFIDENTIAL_STORE_STORE.staticcall(abi.encode(bidId, key, data1)); + function confidentialStore(BidId bidId, string memory key, bytes memory data1) internal view { + (bool success, bytes memory data) = CONFIDENTIAL_STORE.staticcall(abi.encode(bidId, key, data1)); if (!success) { - revert PeekerReverted(CONFIDENTIAL_STORE_STORE, data); + revert PeekerReverted(CONFIDENTIAL_STORE, data); } } diff --git a/suave/sol/libraries/SuaveAbi.sol b/suave/sol/libraries/SuaveAbi.sol index a4da325c50..c2c552cc9c 100644 --- a/suave/sol/libraries/SuaveAbi.sol +++ b/suave/sol/libraries/SuaveAbi.sol @@ -7,8 +7,8 @@ contract SuaveAbi { function newBid(uint64 decryptionCondition, address[] memory allowedPeekers, address[] memory allowedStores, string memory BidType) external view returns (Suave.Bid memory) {} function fetchBids(uint64 cond, string memory namespace) external view returns (Suave.Bid[] memory) {} - function confidentialStoreStore(Suave.BidId bidId, string memory key, bytes memory data) external view {} - function confidentialStoreRetrieve(Suave.BidId bidId, string memory key) external view returns (bytes memory) {} + function confidentialStore(Suave.BidId bidId, string memory key, bytes memory data) external view {} + function confidentialRetrieve(Suave.BidId bidId, string memory key) external view returns (bytes memory) {} function signEthTransaction(bytes memory txn, string memory chainId, string memory signingKey) external view returns (bytes memory) {} function simulateBundle(bytes memory bundleData) external view returns (uint64) {} function extractHint(bytes memory bundleData) external view returns (bytes memory) {} diff --git a/suave/sol/libraries/SuaveForge.sol b/suave/sol/libraries/SuaveForge.sol index 490a94a680..54019706d1 100644 --- a/suave/sol/libraries/SuaveForge.sol +++ b/suave/sol/libraries/SuaveForge.sol @@ -53,13 +53,13 @@ library SuaveForge { return data; } - function confidentialStoreRetrieve(Suave.BidId bidId, string memory key) internal view returns (bytes memory) { + function confidentialRetrieve(Suave.BidId bidId, string memory key) internal view returns (bytes memory) { bytes memory data = forgeIt("0x0000000000000000000000000000000042020001", abi.encode(bidId, key)); return data; } - function confidentialStoreStore(Suave.BidId bidId, string memory key, bytes memory data1) internal view { + function confidentialStore(Suave.BidId bidId, string memory key, bytes memory data1) internal view { bytes memory data = forgeIt("0x0000000000000000000000000000000042020000", abi.encode(bidId, key, data1)); } diff --git a/suave/sol/scripts/forge_example.sol b/suave/sol/scripts/forge_example.sol index b30add9e04..68cd956ebd 100644 --- a/suave/sol/scripts/forge_example.sol +++ b/suave/sol/scripts/forge_example.sol @@ -13,8 +13,8 @@ contract Example is Script { Suave.Bid[] memory allShareMatchBids = SuaveForge.fetchBids(0, "default:v0:ethBundles"); console.log(allShareMatchBids.length); - SuaveForge.confidentialStoreStore(bid.id, "a", abi.encodePacked("bbbbbb")); - bytes memory result = SuaveForge.confidentialStoreRetrieve(bid.id, "a"); + SuaveForge.confidentialStore(bid.id, "a", abi.encodePacked("bbbbbb")); + bytes memory result = SuaveForge.confidentialRetrieve(bid.id, "a"); console.logBytes(result); } } diff --git a/suave/sol/standard_peekers/bids.sol b/suave/sol/standard_peekers/bids.sol index c4877149f0..b57bd1755e 100644 --- a/suave/sol/standard_peekers/bids.sol +++ b/suave/sol/standard_peekers/bids.sol @@ -34,8 +34,8 @@ contract BundleBidContract is AnyBidContract { Suave.Bid memory bid = Suave.newBid(decryptionCondition, bidAllowedPeekers, bidAllowedStores, "default:v0:ethBundles"); - Suave.confidentialStoreStore(bid.id, "default:v0:ethBundles", bundleData); - Suave.confidentialStoreStore(bid.id, "default:v0:ethBundleSimResults", abi.encode(egp)); + Suave.confidentialStore(bid.id, "default:v0:ethBundles", bundleData); + Suave.confidentialStore(bid.id, "default:v0:ethBundleSimResults", abi.encode(egp)); return emitAndReturn(bid, bundleData); } @@ -89,8 +89,8 @@ contract MevShareBidContract is AnyBidContract { // // 4. store bundle and sim results Suave.Bid memory bid = Suave.newBid(decryptionCondition, bidAllowedPeekers, bidAllowedStores, "mevshare:v0:unmatchedBundles"); - Suave.confidentialStoreStore(bid.id, "mevshare:v0:ethBundles", bundleData); - Suave.confidentialStoreStore(bid.id, "mevshare:v0:ethBundleSimResults", abi.encode(egp)); + Suave.confidentialStore(bid.id, "mevshare:v0:ethBundles", bundleData); + Suave.confidentialStore(bid.id, "mevshare:v0:ethBundleSimResults", abi.encode(egp)); emit BidEvent(bid.id, bid.decryptionCondition, bid.allowedPeekers); emit HintEvent(bid.id, hint); @@ -118,14 +118,14 @@ contract MevShareBidContract is AnyBidContract { bytes memory matchHint = Suave.extractHint(matchBundleData); Suave.Bid memory bid = Suave.newBid(decryptionCondition, bidAllowedPeekers, bidAllowedStores, "mevshare:v0:matchBids"); - Suave.confidentialStoreStore(bid.id, "mevshare:v0:ethBundles", matchBundleData); - Suave.confidentialStoreStore(bid.id, "mevshare:v0:ethBundleSimResults", abi.encode(0)); + Suave.confidentialStore(bid.id, "mevshare:v0:ethBundles", matchBundleData); + Suave.confidentialStore(bid.id, "mevshare:v0:ethBundleSimResults", abi.encode(0)); //4. merge bids Suave.BidId[] memory bids = new Suave.BidId[](2); bids[0] = shareBidId; bids[1] = bid.id; - Suave.confidentialStoreStore(bid.id, "mevshare:v0:mergedBids", abi.encode(bids)); + Suave.confidentialStore(bid.id, "mevshare:v0:mergedBids", abi.encode(bids)); return emitMatchBidAndHint(bid, matchHint); } @@ -196,7 +196,7 @@ contract EthBlockBidContract is AnyBidContract { Suave.Bid memory bidToInsert = allShareUserBids[i]; // will be updated with the best match if any for (uint j = 0; j < allShareMatchBids.length; j++) { // TODO: should be done once at the start and sorted - Suave.BidId[] memory mergedBidIds = abi.decode(Suave.confidentialStoreRetrieve(allShareMatchBids[j].id, "mevshare:v0:mergedBids"), (Suave.BidId[])); + Suave.BidId[] memory mergedBidIds = abi.decode(Suave.confidentialRetrieve(allShareMatchBids[j].id, "mevshare:v0:mergedBids"), (Suave.BidId[])); if (idsEqual(mergedBidIds[0], allShareUserBids[i].id)) { bidToInsert = allShareMatchBids[j]; break; @@ -207,7 +207,7 @@ contract EthBlockBidContract is AnyBidContract { EgpBidPair[] memory bidsByEGP = new EgpBidPair[](allBids.length); for (uint i = 0; i < allBids.length; i++) { - bytes memory simResults = Suave.confidentialStoreRetrieve(allBids[i].id, "mevshare:v0:ethBundleSimResults"); + bytes memory simResults = Suave.confidentialRetrieve(allBids[i].id, "mevshare:v0:ethBundleSimResults"); uint64 egp = abi.decode(simResults, (uint64)); bidsByEGP[i] = EgpBidPair(egp, allBids[i].id); } @@ -242,7 +242,7 @@ contract EthBlockBidContract is AnyBidContract { EgpBidPair[] memory bidsByEGP = new EgpBidPair[](allBids.length); for (uint i = 0; i < allBids.length; i++) { - bytes memory simResults = Suave.confidentialStoreRetrieve(allBids[i].id, "default:v0:ethBundleSimResults"); + bytes memory simResults = Suave.confidentialRetrieve(allBids[i].id, "default:v0:ethBundleSimResults"); uint64 egp = abi.decode(simResults, (uint64)); bidsByEGP[i] = EgpBidPair(egp, allBids[i].id); } @@ -283,10 +283,10 @@ contract EthBlockBidContract is AnyBidContract { allowedPeekers[1] = Suave.BUILD_ETH_BLOCK; Suave.Bid memory blockBid = Suave.newBid(blockHeight, allowedPeekers, allowedPeekers, "default:v0:mergedBids"); - Suave.confidentialStoreStore(blockBid.id, "default:v0:mergedBids", abi.encode(bids)); + Suave.confidentialStore(blockBid.id, "default:v0:mergedBids", abi.encode(bids)); (bytes memory builderBid, bytes memory payload) = Suave.buildEthBlock(blockArgs, blockBid.id, namespace); - Suave.confidentialStoreStore(blockBid.id, "default:v0:builderPayload", payload); // only through this.unlock + Suave.confidentialStore(blockBid.id, "default:v0:builderPayload", payload); // only through this.unlock return (blockBid, builderBid); } @@ -302,7 +302,7 @@ contract EthBlockBidContract is AnyBidContract { // TODO: verify the header is correct // TODO: incorporate protocol name - bytes memory payload = Suave.confidentialStoreRetrieve(bidId, "default:v0:builderPayload"); + bytes memory payload = Suave.confidentialRetrieve(bidId, "default:v0:builderPayload"); return payload; } }