diff --git a/arbitrator/Cargo.lock b/arbitrator/Cargo.lock index 9688d07229..2b437968fa 100644 --- a/arbitrator/Cargo.lock +++ b/arbitrator/Cargo.lock @@ -747,12 +747,11 @@ dependencies = [ [[package]] name = "dashmap" -version = "6.1.0" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils", "hashbrown 0.14.5", "lock_api", "once_cell", @@ -975,10 +974,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if 1.0.0", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -1315,6 +1312,15 @@ dependencies = [ "hashbrown 0.14.5", ] +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + [[package]] name = "mach2" version = "0.4.2" @@ -2552,7 +2558,7 @@ dependencies = [ [[package]] name = "wasmer" -version = "4.3.7" +version = "4.2.8" dependencies = [ "bytes", "cfg-if 1.0.0", @@ -2574,12 +2580,12 @@ dependencies = [ "wasmer-types", "wasmer-vm", "wat", - "windows-sys 0.59.0", + "winapi", ] [[package]] name = "wasmer-compiler" -version = "4.3.7" +version = "4.2.8" dependencies = [ "backtrace", "bytes", @@ -2588,7 +2594,6 @@ dependencies = [ "enumset", "lazy_static", "leb128", - "libc", "memmap2 0.5.10", "more-asserts", "region", @@ -2600,13 +2605,12 @@ dependencies = [ "wasmer-types", "wasmer-vm", "wasmparser", - "windows-sys 0.59.0", - "xxhash-rust", + "winapi", ] [[package]] name = "wasmer-compiler-cranelift" -version = "4.3.7" +version = "4.2.8" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -2623,7 +2627,7 @@ dependencies = [ [[package]] name = "wasmer-compiler-llvm" -version = "4.3.7" +version = "4.2.8" dependencies = [ "byteorder", "cc", @@ -2645,7 +2649,7 @@ dependencies = [ [[package]] name = "wasmer-compiler-singlepass" -version = "4.3.7" +version = "4.2.8" dependencies = [ "byteorder", "dynasm", @@ -2662,7 +2666,7 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "4.3.7" +version = "4.2.8" dependencies = [ "proc-macro-error", "proc-macro2", @@ -2672,25 +2676,21 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "4.3.7" +version = "4.2.8" dependencies = [ "bytecheck", "enum-iterator 0.7.0", "enumset", - "getrandom", - "hex", "indexmap 1.9.3", "more-asserts", "rkyv", - "sha2 0.10.8", "target-lexicon", "thiserror", - "xxhash-rust", ] [[package]] name = "wasmer-vm" -version = "4.3.7" +version = "4.2.8" dependencies = [ "backtrace", "cc", @@ -2704,14 +2704,14 @@ dependencies = [ "indexmap 1.9.3", "lazy_static", "libc", - "mach2", + "mach", "memoffset", "more-asserts", "region", "scopeguard", "thiserror", "wasmer-types", - "windows-sys 0.59.0", + "winapi", ] [[package]] @@ -2830,15 +2830,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.6" @@ -2951,12 +2942,6 @@ dependencies = [ "tap", ] -[[package]] -name = "xxhash-rust" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" - [[package]] name = "zerocopy" version = "0.6.6" diff --git a/arbitrator/tools/wasmer b/arbitrator/tools/wasmer index 84aec79c13..6b15433d83 160000 --- a/arbitrator/tools/wasmer +++ b/arbitrator/tools/wasmer @@ -1 +1 @@ -Subproject commit 84aec79c13888bf3fb324ddbd69b3fecc22d4a8c +Subproject commit 6b15433d83f951555c24f0c56dc05e4751b0cc76 diff --git a/arbitrator/wasm-libraries/Cargo.lock b/arbitrator/wasm-libraries/Cargo.lock index e62acf43a6..a5a066e5c9 100644 --- a/arbitrator/wasm-libraries/Cargo.lock +++ b/arbitrator/wasm-libraries/Cargo.lock @@ -518,10 +518,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if 1.0.0", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -1635,20 +1633,16 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "4.3.7" +version = "4.2.8" dependencies = [ "bytecheck", "enum-iterator 0.7.0", "enumset", - "getrandom", - "hex", "indexmap 1.9.3", "more-asserts", "rkyv", - "sha2 0.10.8", "target-lexicon", "thiserror", - "xxhash-rust", ] [[package]] @@ -1809,12 +1803,6 @@ dependencies = [ "tap", ] -[[package]] -name = "xxhash-rust" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" - [[package]] name = "zerocopy" version = "0.7.35" diff --git a/cmd/conf/init.go b/cmd/conf/init.go index 74bd89fd16..97b31958d5 100644 --- a/cmd/conf/init.go +++ b/cmd/conf/init.go @@ -3,6 +3,7 @@ package conf import ( "fmt" "runtime" + "slices" "strings" "time" @@ -106,7 +107,7 @@ func (c *InitConfig) Validate() error { if c.Force && c.RecreateMissingStateFrom > 0 { log.Warn("force init enabled, recreate-missing-state-from will have no effect") } - if c.Latest != "" && !isAcceptedSnapshotKind(c.Latest) { + if c.Latest != "" && !slices.Contains(acceptedSnapshotKinds, c.Latest) { return fmt.Errorf("invalid value for latest option: \"%s\" %s", c.Latest, acceptedSnapshotKindsStr) } if c.Prune != "" && c.PruneThreads <= 0 { @@ -139,12 +140,3 @@ var ( acceptedSnapshotKinds = []string{"archive", "pruned", "genesis"} acceptedSnapshotKindsStr = "(accepted values: \"" + strings.Join(acceptedSnapshotKinds, "\" | \"") + "\")" ) - -func isAcceptedSnapshotKind(kind string) bool { - for _, valid := range acceptedSnapshotKinds { - if kind == valid { - return true - } - } - return false -} diff --git a/das/google_cloud_storage_service.go b/das/google_cloud_storage_service.go index 829f4b5265..71924a690c 100644 --- a/das/google_cloud_storage_service.go +++ b/das/google_cloud_storage_service.go @@ -23,7 +23,7 @@ import ( type GoogleCloudStorageOperator interface { Bucket(name string) *googlestorage.BucketHandle - Upload(ctx context.Context, bucket, objectPrefix string, value []byte) error + Upload(ctx context.Context, bucket, objectPrefix string, value []byte, discardAfterTimeout bool, timeout uint64) error Download(ctx context.Context, bucket, objectPrefix string, key common.Hash) ([]byte, error) Close(ctx context.Context) error } @@ -36,15 +36,21 @@ func (g *GoogleCloudStorageClient) Bucket(name string) *googlestorage.BucketHand return g.client.Bucket(name) } -func (g *GoogleCloudStorageClient) Upload(ctx context.Context, bucket, objectPrefix string, value []byte) error { +func (g *GoogleCloudStorageClient) Upload(ctx context.Context, bucket, objectPrefix string, value []byte, discardAfterTimeout bool, timeout uint64) error { obj := g.client.Bucket(bucket).Object(objectPrefix + EncodeStorageServiceKey(dastree.Hash(value))) w := obj.NewWriter(ctx) + if discardAfterTimeout && timeout <= math.MaxInt64 { + w.Retention = &googlestorage.ObjectRetention{ + Mode: "Unlocked", + RetainUntil: time.Unix(int64(timeout), 0), + } + } + if _, err := fmt.Fprintln(w, value); err != nil { return err } return w.Close() - } func (g *GoogleCloudStorageClient) Download(ctx context.Context, bucket, objectPrefix string, key common.Hash) ([]byte, error) { @@ -61,32 +67,30 @@ func (g *GoogleCloudStorageClient) Close(ctx context.Context) error { } type GoogleCloudStorageServiceConfig struct { - Enable bool `koanf:"enable"` - AccessToken string `koanf:"access-token"` - Bucket string `koanf:"bucket"` - ObjectPrefix string `koanf:"object-prefix"` - EnableExpiry bool `koanf:"enable-expiry"` - MaxRetention time.Duration `koanf:"max-retention"` + Enable bool `koanf:"enable"` + AccessToken string `koanf:"access-token"` + AccessTokenFile string `koanf:"access-token-file"` + Bucket string `koanf:"bucket"` + ObjectPrefix string `koanf:"object-prefix"` + DiscardAfterTimeout bool `koanf:"discard-after-timeout"` } var DefaultGoogleCloudStorageServiceConfig = GoogleCloudStorageServiceConfig{} func GoogleCloudConfigAddOptions(prefix string, f *flag.FlagSet) { f.Bool(prefix+".enable", DefaultGoogleCloudStorageServiceConfig.Enable, "EXPERIMENTAL/unsupported - enable storage/retrieval of sequencer batch data from an Google Cloud Storage bucket") - f.String(prefix+".access-token", DefaultGoogleCloudStorageServiceConfig.AccessToken, "Google Cloud Storage access token") + f.String(prefix+".access-token", DefaultGoogleCloudStorageServiceConfig.AccessToken, "Google Cloud Storage access token (JSON string)") + f.String(prefix+".access-token-file", DefaultGoogleCloudStorageServiceConfig.AccessTokenFile, "Google Cloud Storage access token (JSON file path)") f.String(prefix+".bucket", DefaultGoogleCloudStorageServiceConfig.Bucket, "Google Cloud Storage bucket") f.String(prefix+".object-prefix", DefaultGoogleCloudStorageServiceConfig.ObjectPrefix, "prefix to add to Google Cloud Storage objects") - f.Bool(prefix+".enable-expiry", DefaultLocalFileStorageConfig.EnableExpiry, "enable expiry of batches") - f.Duration(prefix+".max-retention", DefaultLocalFileStorageConfig.MaxRetention, "store requests with expiry times farther in the future than max-retention will be rejected") - + f.Bool(prefix+".discard-after-timeout", DefaultGoogleCloudStorageServiceConfig.DiscardAfterTimeout, "discard data after its expiry timeout") } type GoogleCloudStorageService struct { - operator GoogleCloudStorageOperator - bucket string - objectPrefix string - enableExpiry bool - maxRetention time.Duration + operator GoogleCloudStorageOperator + bucket string + objectPrefix string + discardAfterTimeout bool } func NewGoogleCloudStorageService(config GoogleCloudStorageServiceConfig) (StorageService, error) { @@ -94,57 +98,29 @@ func NewGoogleCloudStorageService(config GoogleCloudStorageServiceConfig) (Stora var err error // Note that if the credentials are not specified, the client library will find credentials using ADC(Application Default Credentials) // https://cloud.google.com/docs/authentication/provide-credentials-adc. - if config.AccessToken == "" { - client, err = googlestorage.NewClient(context.Background()) - } else { + if config.AccessToken != "" { client, err = googlestorage.NewClient(context.Background(), option.WithCredentialsJSON([]byte(config.AccessToken))) + } else if config.AccessTokenFile != "" { + client, err = googlestorage.NewClient(context.Background(), option.WithCredentialsFile(config.AccessTokenFile)) + } else { + client, err = googlestorage.NewClient(context.Background()) } if err != nil { return nil, fmt.Errorf("error creating Google Cloud Storage client: %w", err) } service := &GoogleCloudStorageService{ - operator: &GoogleCloudStorageClient{client: client}, - bucket: config.Bucket, - objectPrefix: config.ObjectPrefix, - enableExpiry: config.EnableExpiry, - maxRetention: config.MaxRetention, - } - if config.EnableExpiry { - lifecycleRule := googlestorage.LifecycleRule{ - Action: googlestorage.LifecycleAction{Type: "Delete"}, - Condition: googlestorage.LifecycleCondition{AgeInDays: int64(config.MaxRetention.Hours() / 24)}, // Objects older than 30 days - } - ctx := context.Background() - bucket := service.operator.Bucket(service.bucket) - // check if bucket exists (and others), and update expiration policy if enabled - attrs, err := bucket.Attrs(ctx) - if err != nil { - return nil, fmt.Errorf("error getting bucket attributes: %w", err) - } - attrs.Lifecycle.Rules = append(attrs.Lifecycle.Rules, lifecycleRule) - - bucketAttrsToUpdate := googlestorage.BucketAttrsToUpdate{ - Lifecycle: &attrs.Lifecycle, - } - if _, err := bucket.Update(ctx, bucketAttrsToUpdate); err != nil { - return nil, fmt.Errorf("failed to update bucket lifecycle: %w", err) - } + operator: &GoogleCloudStorageClient{client: client}, + bucket: config.Bucket, + objectPrefix: config.ObjectPrefix, + discardAfterTimeout: config.DiscardAfterTimeout, } return service, nil } -func (gcs *GoogleCloudStorageService) Put(ctx context.Context, data []byte, expiry uint64) error { - logPut("das.GoogleCloudStorageService.Store", data, expiry, gcs) - if expiry > math.MaxInt64 { - return fmt.Errorf("request expiry time (%v) exceeds max int64", expiry) - } - // #nosec G115 - expiryTime := time.Unix(int64(expiry), 0) - currentTimePlusRetention := time.Now().Add(gcs.maxRetention) - if expiryTime.After(currentTimePlusRetention) { - return fmt.Errorf("requested expiry time (%v) exceeds current time plus maximum allowed retention period(%v)", expiryTime, currentTimePlusRetention) - } - if err := gcs.operator.Upload(ctx, gcs.bucket, gcs.objectPrefix, data); err != nil { +func (gcs *GoogleCloudStorageService) Put(ctx context.Context, value []byte, timeout uint64) error { + logPut("das.GoogleCloudStorageService.Store", value, timeout, gcs) + + if err := gcs.operator.Upload(ctx, gcs.bucket, gcs.objectPrefix, value, gcs.discardAfterTimeout, timeout); err != nil { log.Error("das.GoogleCloudStorageService.Store", "err", err) return err } @@ -162,10 +138,10 @@ func (gcs *GoogleCloudStorageService) GetByHash(ctx context.Context, key common. } func (gcs *GoogleCloudStorageService) ExpirationPolicy(ctx context.Context) (daprovider.ExpirationPolicy, error) { - if gcs.enableExpiry { - return daprovider.KeepForever, nil + if gcs.discardAfterTimeout { + return daprovider.DiscardAfterDataTimeout, nil } - return daprovider.DiscardAfterDataTimeout, nil + return daprovider.KeepForever, nil } func (gcs *GoogleCloudStorageService) Sync(ctx context.Context) error { @@ -184,8 +160,6 @@ func (gcs *GoogleCloudStorageService) HealthCheck(ctx context.Context) error { bucket := gcs.operator.Bucket(gcs.bucket) // check if we have bucket permissions permissions := []string{ - "storage.buckets.get", - "storage.buckets.list", "storage.objects.create", "storage.objects.delete", "storage.objects.list", diff --git a/das/google_cloud_storage_service_test.go b/das/google_cloud_storage_service_test.go index 94d6f3ee44..545437708b 100644 --- a/das/google_cloud_storage_service_test.go +++ b/das/google_cloud_storage_service_test.go @@ -34,7 +34,7 @@ func (c *mockGCSClient) Close(ctx context.Context) error { return nil } -func (c *mockGCSClient) Upload(ctx context.Context, bucket, objectPrefix string, value []byte) error { +func (c *mockGCSClient) Upload(ctx context.Context, bucket, objectPrefix string, value []byte, discardAfterTimeout bool, timeout uint64) error { key := objectPrefix + EncodeStorageServiceKey(dastree.Hash(value)) c.storage[key] = value return nil @@ -47,7 +47,7 @@ func NewTestGoogleCloudStorageService(ctx context.Context, googleCloudStorageCon operator: &mockGCSClient{ storage: make(map[string][]byte), }, - maxRetention: googleCloudStorageConfig.MaxRetention, + discardAfterTimeout: true, }, nil } @@ -57,7 +57,6 @@ func TestNewGoogleCloudStorageService(t *testing.T) { expiry := uint64(time.Now().Add(time.Hour).Unix()) googleCloudStorageServiceConfig := DefaultGoogleCloudStorageServiceConfig googleCloudStorageServiceConfig.Enable = true - googleCloudStorageServiceConfig.MaxRetention = time.Hour * 24 googleCloudService, err := NewTestGoogleCloudStorageService(ctx, googleCloudStorageServiceConfig) Require(t, err) diff --git a/docs/decisions/0000-use-markdown-architectural-decision-records.md b/docs/decisions/0000-use-markdown-architectural-decision-records.md new file mode 100644 index 0000000000..506f5fa28b --- /dev/null +++ b/docs/decisions/0000-use-markdown-architectural-decision-records.md @@ -0,0 +1,29 @@ +# Use Markdown Architectural Decision Records + +## Context and Problem Statement + +We want to record architectural decisions made in this project independent +whether decisions concern the architecture ("architectural decision record"), +the code, or other fields. + +Which format and structure should these records follow? + +## Considered Options + +* [MADR](https://adr.github.io/madr/) 4.0.0 – The Markdown Architectural Decision Records +* [Michael Nygard's template](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions) – The first incarnation of the term "ADR" +* [Sustainable Architectural Decisions](https://www.infoq.com/articles/sustainable-architectural-design-decisions) – The Y-Statements +* Other templates listed at +* Formless – No conventions for file format and structure + +## Decision Outcome + +Chosen option: "MADR 4.0.0", because + +* Implicit assumptions should be made explicit. + Design documentation is important to enable people understanding the decisions later on. + See also ["A rational design process: How and why to fake it"](https://doi.org/10.1109/TSE.1986.6312940). +* MADR allows for structured capturing of any decision. +* The MADR format is lean and fits our development style. +* The MADR structure is comprehensible and facilitates usage & maintenance. +* The MADR project is vivid. diff --git a/docs/decisions/0001-avoid-primitive-constraint-types.md b/docs/decisions/0001-avoid-primitive-constraint-types.md new file mode 100644 index 0000000000..8a3ecb0632 --- /dev/null +++ b/docs/decisions/0001-avoid-primitive-constraint-types.md @@ -0,0 +1,96 @@ +--- +status: accepted +date: 2024-11-29 +decision-makers: eljobe@ plasmapower@ +--- + +# Avoid primitive constraint types + +## Context and Problem Statement + +When working on the go code for BoLD, we became slightly annoyed that several +places in the history package were checking the constraint that the `virtual` +argumet to a function was positive. One possible workaround would have been +to create a constrained wrapper type around `uint64` which would only allow +positive values. For example: + +```go +// Pos64 is a type which represents a positive uint64. +// +// The "zero" value of Pos64 is 1. +type Pos64 struct { + uint64 +} + +// NewPos64 returns a new Pos64 with the given value. +// +// errors if v is 0. +func NewPos64(v uint64) (Pos64, error) { + if v == 0 { + return Pos64{}, errors.New("v must be positive. got: 0") + } + return Pos64{v}, nil +} + +// MustPos64 returns a new Pos64 with the given value. +// +// panics if v is 0. +func MustPos64(v uint64) Pos64 { + if v == 0 { + panic("v must be positive. got: 0") + } + return Pos64{v} +} + +// Val returns the value of the Pos64. +func (p Pos64) Val() uint64 { + // The zero value of Pos64 is 1. + if p.uint64 == 0 { + return 1 + } + return p.uint64 +} +``` + +The idea being that within a package, all of the functions which needed to deal +with a `virtual` argument, could take in a `Pos64` instead of a `uint64` and it +would be up to clients of the package to ensure that they only passed in +positive values. + +## Considered Options + +* New Package: `util/chk` for checking type constraint +* Status Quo: check the constraint in multiple places +* Minimize Checks: no check in package private functions + +## Decision Outcome + +Chosen option: "Status Quo", because the "New Package" option introduces a +regression in being able to use type type with operators, and "Minimize Checks" +is too prone to bugs introduced by refactoring. + + +## Pros and Cons of the Options + +### New Pacakge: `util/chk` for checking type constraint + +* Good, because it is expressive +* Good, because the constraint only needs to be checked during construction +* Bad, because `Pos64` doesn't compile with operators like `+ * - /` + +### Status Quo: check the constraint in multiple places + +* Good, because it is what the code is already doing +* Good, because when a funciton becomes public, the constraint holds +* Good, because when a function moves to another file or package, the constraint holds +* Bad, because it means the check may need to be repeated. DRY + +### Minimize Checks: no check in package private functions + +* Good, because it reduces the amount of times a constraint is checked +* Bad, because the assumption might be violated if a private function becomes + public, or gains an additional caller. + +## More Information + +See the discussion on now-closed #2743 diff --git a/docs/decisions/README.md b/docs/decisions/README.md new file mode 100644 index 0000000000..63b1a18cd2 --- /dev/null +++ b/docs/decisions/README.md @@ -0,0 +1,10 @@ +# Decisions + +For new Architectural Decision Records (ADRs), please use one of the following templates as a starting point: + +* [adr-template.md](adr-template.md) has all sections, with explanations about them. +* [adr-template-minmal.md](adr-template-minimal.md) only contains mandatory sections, with explanations about them. +* [adr-template-bare.md](adr-template-bare.md) has all sections, wich are empty (no explanations). +* [adr-template-bare-minimal.md](adr-template-bare-minimal.md) has the mandatory sections, without explanations. + +The MADR documentation is available at while general information about ADRs is available at . diff --git a/docs/decisions/adr-template-bare-minimal.md b/docs/decisions/adr-template-bare-minimal.md new file mode 100644 index 0000000000..bd16d0ea21 --- /dev/null +++ b/docs/decisions/adr-template-bare-minimal.md @@ -0,0 +1,16 @@ +# + +## Context and Problem Statement + + + +## Considered Options + + + +## Decision Outcome + + + +### Consequences + diff --git a/docs/decisions/adr-template-bare.md b/docs/decisions/adr-template-bare.md new file mode 100644 index 0000000000..26f6598f70 --- /dev/null +++ b/docs/decisions/adr-template-bare.md @@ -0,0 +1,44 @@ +--- +status: +date: +decision-makers: +consulted: +informed: +--- + +# + +## Context and Problem Statement + + + +## Decision Drivers + +* + +## Considered Options + +* + +## Decision Outcome + +Chosen option: "", because + +### Consequences + +* Good, because +* Bad, because + +### Confirmation + + + +## Pros and Cons of the Options + +### + +* Good, because +* Neutral, because +* Bad, because + +## More Information diff --git a/docs/decisions/adr-template-minimal.md b/docs/decisions/adr-template-minimal.md new file mode 100644 index 0000000000..267640bfbc --- /dev/null +++ b/docs/decisions/adr-template-minimal.md @@ -0,0 +1,23 @@ +# {short title, representative of solved problem and found solution} + +## Context and Problem Statement + +{Describe the context and problem statement, e.g., in free form using two to three sentences or in the form of an illustrative story. You may want to articulate the problem in form of a question and add links to collaboration boards or issue management systems.} + +## Considered Options + +* {title of option 1} +* {title of option 2} +* {title of option 3} +* … + +## Decision Outcome + +Chosen option: "{title of option 1}", because {justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force {force} | … | comes out best (see below)}. + + +### Consequences + +* Good, because {positive consequence, e.g., improvement of one or more desired qualities, …} +* Bad, because {negative consequence, e.g., compromising one or more desired qualities, …} +* … diff --git a/docs/decisions/adr-template.md b/docs/decisions/adr-template.md new file mode 100644 index 0000000000..08dac30ed8 --- /dev/null +++ b/docs/decisions/adr-template.md @@ -0,0 +1,74 @@ +--- +# These are optional metadata elements. Feel free to remove any of them. +status: "{proposed | rejected | accepted | deprecated | … | superseded by ADR-0123" +date: {YYYY-MM-DD when the decision was last updated} +decision-makers: {list everyone involved in the decision} +consulted: {list everyone whose opinions are sought (typically subject-matter experts); and with whom there is a two-way communication} +informed: {list everyone who is kept up-to-date on progress; and with whom there is a one-way communication} +--- + +# {short title, representative of solved problem and found solution} + +## Context and Problem Statement + +{Describe the context and problem statement, e.g., in free form using two to three sentences or in the form of an illustrative story. You may want to articulate the problem in form of a question and add links to collaboration boards or issue management systems.} + + +## Decision Drivers + +* {decision driver 1, e.g., a force, facing concern, …} +* {decision driver 2, e.g., a force, facing concern, …} +* … + +## Considered Options + +* {title of option 1} +* {title of option 2} +* {title of option 3} +* … + +## Decision Outcome + +Chosen option: "{title of option 1}", because {justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force {force} | … | comes out best (see below)}. + + +### Consequences + +* Good, because {positive consequence, e.g., improvement of one or more desired qualities, …} +* Bad, because {negative consequence, e.g., compromising one or more desired qualities, …} +* … + + +### Confirmation + +{Describe how the implementation of/compliance with the ADR can/will be confirmed. Are the design that was decided for and its implementation in line with the decision made? E.g., a design/code review or a test with a library such as ArchUnit can help validate this. Not that although we classify this element as optional, it is included in many ADRs.} + + +## Pros and Cons of the Options + +### {title of option 1} + + +{example | description | pointer to more information | …} + +* Good, because {argument a} +* Good, because {argument b} + +* Neutral, because {argument c} +* Bad, because {argument d} +* … + +### {title of other option} + +{example | description | pointer to more information | …} + +* Good, because {argument a} +* Good, because {argument b} +* Neutral, because {argument c} +* Bad, because {argument d} +* … + + +## More Information + +{You might want to provide additional evidence/confidence for the decision outcome here and/or document the team agreement on the decision and/or define when/how this decision the decision should be realized and if/when it should be re-visited. Links to other decisions and resources might appear here as well.} diff --git a/execution/gethexec/executionengine.go b/execution/gethexec/executionengine.go index f4a341c7e1..12f22e7321 100644 --- a/execution/gethexec/executionengine.go +++ b/execution/gethexec/executionengine.go @@ -534,6 +534,8 @@ func (s *ExecutionEngine) sequenceTransactionsWithBlockMutex(header *arbostypes. if err != nil { return nil, err } + statedb.StartPrefetcher("Sequencer") + defer statedb.StopPrefetcher() delayedMessagesRead := lastBlockHeader.Nonce.Uint64() diff --git a/go-ethereum b/go-ethereum index 9257e4f31f..e543bb1699 160000 --- a/go-ethereum +++ b/go-ethereum @@ -1 +1 @@ -Subproject commit 9257e4f31fd9fac62748150a81c1a2296e18ae4e +Subproject commit e543bb1699e7c3d7d6bf4ef02a49dfbefc19397d