mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-07 13:34:27 +00:00
build, cmd/keeper: add "womir" target
Co-authored-by: Leo <leo@powdrlabs.com>
This commit is contained in:
parent
a7d09cc14f
commit
4d33061c51
4 changed files with 64 additions and 9 deletions
16
build/ci.go
16
build/ci.go
|
|
@ -107,6 +107,12 @@ var (
|
||||||
Tags: "ziren",
|
Tags: "ziren",
|
||||||
Env: map[string]string{"GOMIPS": "softfloat", "CGO_ENABLED": "0"},
|
Env: map[string]string{"GOMIPS": "softfloat", "CGO_ENABLED": "0"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "womir",
|
||||||
|
GOOS: "js",
|
||||||
|
GOARCH: "wasm",
|
||||||
|
Tags: "womir",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "wasm-js",
|
Name: "wasm-js",
|
||||||
GOOS: "js",
|
GOOS: "js",
|
||||||
|
|
@ -163,11 +169,11 @@ var (
|
||||||
|
|
||||||
// Distros for which packages are created
|
// Distros for which packages are created
|
||||||
debDistros = []string{
|
debDistros = []string{
|
||||||
"xenial", // 16.04, EOL: 04/2026
|
"xenial", // 16.04, EOL: 04/2026
|
||||||
"bionic", // 18.04, EOL: 04/2028
|
"bionic", // 18.04, EOL: 04/2028
|
||||||
"focal", // 20.04, EOL: 04/2030
|
"focal", // 20.04, EOL: 04/2030
|
||||||
"jammy", // 22.04, EOL: 04/2032
|
"jammy", // 22.04, EOL: 04/2032
|
||||||
"noble", // 24.04, EOL: 04/2034
|
"noble", // 24.04, EOL: 04/2034
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is where the tests should be unpacked.
|
// This is where the tests should be unpacked.
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,8 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//go:build wasm
|
//go:build wasm && !womir
|
||||||
// +build wasm
|
// +build wasm,!womir
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
|
||||||
49
cmd/keeper/getpayload_womir.go
Normal file
49
cmd/keeper/getpayload_womir.go
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
// Copyright 2026 The go-ethereum Authors
|
||||||
|
// This file is part of the go-ethereum library.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is free software: you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// The go-ethereum library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
//go:build womir
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
|
// These match the WOMIR guest-io imports (env module).
|
||||||
|
// Protocol: __hint_input prepares next item, __hint_buffer reads words.
|
||||||
|
// Each item has format: [byte_len_u32_le, ...data_words_padded_to_4bytes]
|
||||||
|
//
|
||||||
|
//go:wasmimport env __hint_input
|
||||||
|
func hintInput()
|
||||||
|
|
||||||
|
//go:wasmimport env __hint_buffer
|
||||||
|
func hintBuffer(ptr unsafe.Pointer, numWords uint32)
|
||||||
|
func readWord() uint32 {
|
||||||
|
var buf [4]byte
|
||||||
|
hintBuffer(unsafe.Pointer(&buf[0]), 1)
|
||||||
|
return uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24
|
||||||
|
}
|
||||||
|
func readBytes() []byte {
|
||||||
|
hintInput()
|
||||||
|
byteLen := readWord()
|
||||||
|
numWords := (byteLen + 3) / 4
|
||||||
|
data := make([]byte, numWords*4)
|
||||||
|
hintBuffer(unsafe.Pointer(&data[0]), numWords)
|
||||||
|
return data[:byteLen]
|
||||||
|
}
|
||||||
|
|
||||||
|
// getInput reads the RLP-encoded Payload from the WOMIR hint stream.
|
||||||
|
func getInput() []byte {
|
||||||
|
return readBytes()
|
||||||
|
}
|
||||||
|
|
@ -14,8 +14,8 @@
|
||||||
// You should have received a copy of the GNU Lesser General Public License
|
// You should have received a copy of the GNU Lesser General Public License
|
||||||
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
//go:build !example && !ziren && !wasm
|
//go:build !example && !ziren && !wasm && !womir
|
||||||
// +build !example,!ziren,!wasm
|
// +build !example,!ziren,!wasm,!womir
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue